When I create a thread (pthread_create()
) from my main process, I see three (3) threads in the ps
listing, why is this? That is, I see the process
You are seeing one thread more than you are creating because you are not counting the programs main thread.
Every time you start a program, you fire up a process that has 1 thread running. If you pthread_create
one thread, then you have two threads running. You pthread_create
a second one and you get three threads running.
That is why your ps
(which according to you on one of the comments) shows threads, is showing you one more than the number of your pthread_create
s.