【发布时间】:2012-02-28 08:41:50
【问题描述】:
假设我有一个这样组成的文本文件
#####
typeofthread1
#####
typeofthread2
等等……
在我的主目录中,我想读取该文件,获取字符串 typeofthread1、typeofthread2 并使用创建不同的线程
pthread_t threads[NUM_THREADS];
for (i=0;i<NUM_THREADS;i++)
pthread_create(&threads[i], NULL, -> HERE <- , void * arg);
如何将刚刚读取的 typeofthread1、typeofthread2 字符串放入 -> HERE
我想这样做是因为我想创建一个程序来创建不同类型的线程,这取决于我想要做什么,并从文本文件(某种配置文件)中选择它
有什么建议吗?
【问题讨论】:
标签: c multithreading file dynamic