发新话题
打印

pth线程问题?

pth线程问题?

  下面程序的线程没有执行(编译通过了),为什么?怎么解决?
#include <pth.h>
void *thread_function(void* arg);
int main()
{
      pth_init();
      pth_spawn(PTH_ATTR_DEFAULT, thread_function,NULL);
      while(1)
      {       int i;
             printf("nihao\n");
             for(i=0;i<100000000;i++);
      }
      pth_stop();
}
void *thread_function(void * arg)
{       printf("111111111111111111");
      
}
pth.h ??
我只用过  pthread
目前对这个还不大了解
发新话题