Tag: pthreads win32

pthread_create没有足够的空间

我在Windows上使用Pthreads和MinGW。 对pthread_create的调用返回一个错误,该错误转换为“空间不足”。 它指的是什么样的空间? 是线程堆栈空间吗? int scannerThreadReturnValue = pthread_create(&parserThreadHandle, &attr, parserThread, (void *)filename); if(scannerThreadReturnValue != 0) { printf(“Unable to create thread %s\n”, strerror(errno)); } else printf(“Parser thread creation successfull\n”);

sem_timedwait()pthreads-win32 errno用法

我在Win32应用程序上使用pthreads-win32作为线程。 我正在使用此处发布的第一个函数计算timespec。 对sem_timedwait()的调用似乎在等待指定的ts时间,但是每次完成时我都会得到以下消息: 等待信号量时出错:没有错误 我在这里检查了sem_timedwait.c的文件,它们指定了相同的errno值和返回值。 因此,我不知道为什么它会退出这个错误,并想知道原因。 #ifdef _WIN32 #define HAVE_STRUCT_TIMESPEC #endif // _WIN32 #include #include #include #include #include #include #include #include #include “include.h” // Platform includes #ifdef _WIN32 #include #include #else #include #include #include #include #include #include #endif // _WIN32 // … sem_init(&job_semaphore, 0, 0); // … // Set wait time relative to current time […]

我不能在窗口平台上使用pthread

我的env是Windows8.1(64位)并使用Visual Studio 2010。 我确实将所有* .dll文件放在system32,SYSWOW64中(因为我使用win8 64bit。) 并使用VC 2010链接x64-system的* .lib文件的位置。 当然,我添加额外的文件夹lib forders ..,包括文件夹..等.. 但是当我尝试编译“pthread-used”项目时,会发生致命错误。 -资源 #include #include int doit_id,trd_id; pthread_t trd; void *doit(void *data){ doit_id = (int)data; return 0; } int main(){ trd_id=pthread_create(&trd,NULL,doit,0); return (0); } -错误 1.obj : error LNK2019: unresolved external symbol __imp__pthread_create (referenced in function _main) C:\Users\~program Location~ : fatal error LNK1120: 1 […]