Сделал простую программу (pthread-test1) с использованием pthread на RedHat 8. В результате ее запуска по 'ps -AH' видно только один процесс pthread-test1 вообще без дочерних. Что за ерунда? Или это может особенность RH8? ==================================================================== #include <pthread.h> #include <stdio.h> #include <time.h> int glob = 0; void *thread_proc(void *val) { int i = 0; // nice(10); while (1) { printf((char *) val); printf("[%d] %d clocks %d %d %d\n", pthread_self(), clock(), i++, glob++, getpriority()); }; return NULL; }; int main() { pthread_t tid1, tid2, tid3, tid4; pthread_create (&tid1, NULL, &thread_proc, (void *) "String 1 "); pthread_create (&tid2, NULL, &thread_proc, (void *) "String 2 "); pthread_create (&tid3, NULL, &thread_proc, (void *) "String 3 "); pthread_create (&tid4, NULL, &thread_proc, (void *) "String 4 "); int i = 0; while (1) { printf("Main thread "); printf("%d clocks %d %d\n", clock(), i++, glob++); }; return 0; }; ====================================================================







Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.
Похожие темы
- Форум нити (2007)
- Форум Posix Threads (2005)
- Форум pthreads - ошибка линковки (2001)
- Форум posix thread [C] (2006)
- Форум Треды и segfault (2010)
- Форум Завершение потока: остается занятая память. (2009)
- Форум Проблема (2002)
- Форум pthread_create и прочий бред. (2004)
- Форум Утекает память при завершении потока. (2006)
- Форум снова нити (2007)