Top "Pthreads" questions

Pthreads (POSIX Threads) is a standardised C-based API for creating and manipulating threads.

C warning: incompatible pointer types passing

I keep getting an error when trying to compile my code. The error is as follows : warning: incompatible pointer types …

c pointers parameters pthreads incompatibletypeerror
what is the "attribute" of a pthread mutex?

The function pthread_mutex_init allows you to specify a pointer to an attribute. But I have yet to find …

attributes pthreads mutex
Cancelling a thread using pthread_cancel : good practice or bad

I have a C++ program on Linux (CentOS 5.3) spawning multiple threads which are in an infinite loop to perform a …

c++ linux pthreads
How can I kill a pthread that is in an infinite loop, from outside that loop?

I create a thread and I put it into an infinite loop. I get memory leaks when checking the code …

c memory-leaks pthreads threadpool
valgrind memory leak errors when using pthread_create

I'm writing a program using the pthread library. When I run my program with the command valgrind --leak-check=full, I …

c++ memory-leaks pthreads valgrind
pthread_exit vs. return

I have a joinable pthread runner function defined as below: void *sumOfProducts(void *param) { ... pthread_exit(0); } This thread is supposed …

c linux pthreads valgrind
Existing threadpool C implementation

What open-source implementation(s) in C for a pthreads thread pool would you recommend ? Additional points if this implementation is : …

c multithreading open-source pthreads threadpool
Do I need -D_REENTRANT with -pthreads?

On Linux (kernel 2.6.5) our build system calls gcc with -D_REENTRANT. Is this still required when using pthreads? How is …

linux gcc pthreads
How do I determine if a detached pthread is alive?

How do I determine if a detached pthread is still alive ? I have a communication channel with the thread (a …

linux pthreads
Php: when to use pthread

I don't know much about using threads but I looked into pthreads for php and it seems very interesting and …

php multithreading pthreads die