Top "Pthreads" questions

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

ps display thread name

Is there a way for ps (or similar tool) to display the pthread's name? I wrote the following simple program: // …

linux pthreads ps
How much overhead is there when creating a thread?

I just reviewed some really terrible code - code that sends messages on a serial port by creating a new …

c++ pthreads posix
Pthreads vs. OpenMP

I'm creating a multi-threaded application in C using Linux. I'm unsure whether I should use the POSIX thread API or …

c pthreads openmp
Calling pthread_cond_signal without locking mutex

I read somewhere that we should lock the mutex before calling pthread_cond_signal and unlock the mutex after calling …

c++ pthreads mutex signals condition-variable
Static pthreads mutex initialization

Using pthreads, how would one, in C, initialize a static array of mutexes? For a single static mutex, it seems …

c pthreads mutex static-initialization
Which is more efficient, basic mutex lock or atomic integer?

For something simple like a counter if multiple threads will be increasing the number. I read that mutex locks can …

multithreading operating-system pthreads mutex atomic
pthread_detach question

Till recently, I was under the impression that if you "detach" a thread after spawning it, the thread lives even …

c linux multithreading pthreads
Do sleep functions sleep all threads or just the one who call it?

I am programming with pthread on linux(Centos)? I wanna to threads sleep a short time to wait for something. …

c multithreading pthreads sleep thread-sleep
How to get CMake to recognize pthread on Ubuntu?

If I compile on the command-line with g++ directly, I can see everything I need is there: $ g++ -pthread test.…

c++ pthreads cmake ubuntu-12.10
Does pthread_cond_wait(&cond_t, &mutex); unlock and then lock the mutex?

I m using pthread_cond_wait(&cond_t, &mutex); in my program and I m wondering why this …

c pthreads mutex