你好,我是SPDK的新手,已经完成了https://spdk.io/doc/getting_started.html中提到的所有步骤,并且没有观察到任何错误。
但是当我在我的系统上运行下面的简单代码时
#include <stdio.h>
#include <spdk/bdev.h>
#include <spdk/thread.h>
#include <spdk/queue.h>
void main()
{
struct spdk_thread* first_reader_thread =
spdk_thread_create("first_reader_thread", NULL);
if (first_reader_thread == NULL)
{
printf("First thread creation failed...\n");
return ;
}
struct spdk_thread* second_reader_thread =
spdk_thread_create("second_reader_thread", NULL);
if (second_reader_thread == NULL)
{
printf("Second thread creation failed...\n");
return ;
}
printf("first reader thread id is: %"PRIu64"\n",
spdk_thread_get_id(first_reader_thread));
printf("second reader thread id is: %"PRIu64"\n",
spdk_thread_get_id(second_reader_thread));
printf("Hello World!\n");
return;
}我得到以下错误:
“ERROR::无法为循环预留内存,260:spdk_thread_create:无法为消息环分配内存,第一次线程创建失败.”
如果有人能引导我纠正这个错误,那将是可行的。
发布于 2022-10-23 16:03:25
在使用SPDK库中的任何API之前,应先初始化SPDK环境。
尝试在其他操作之前调用spdk_env_init。
https://stackoverflow.com/questions/61590039
复制相似问题