3

Is a Linux process considered a thread?

For example, if I write a simple c program that calls pthread_create to create a new thread in main(), does that mean that I now have 2 threads, one for main() and the newly created one? Or does only the spawned thread count as a thread but not the main() process?

I was wondering because by calling pthread_join to join the spawned thread to main() it seems like I'm joining threads together, thus implying that the main process is a thread.

Please also correct me if I use the wrong terminology. :)

1

From man pthreads in my computer

 In  addition  to  the **main (initial) thread**, and the threads that the 
 program creates using pthread_create(3), the implementation creates a 
 "manager" thread.  This thread handles thread creation and termination.
 (Problems can result if this thread  is  inad‐ vertently killed.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.