Using the pthread library in C, is it possible to send a SIGSTOP signal to an individual thread?
I want to ensure that even though I create N threads in a loop, all should start executing only when all of them have been created.
I ask because the man page for pthread_kill() mentions:
Signal dispositions are
process-wide: if a signal handler is
installed, the handler will be invoked
in the
thread thread, but if the disposition of the signal is “stop”,
“continue”, or “terminate”, this
action will
affect the whole process.
Barriers (see
pthread_barrier_init) are an even easier way to accomplish what you need.