c++ - Pthreads - main thread and other thread -


in pthreads, when create multiple threads inside main function, created threads become worker thread main thread? or each thread manager thread itself?

when create multiple threads inside main function, created threads become worker thread main thread?

worker/main thread designation conceptual.

there's no pthreads designated thread manages other worker threads. typically, main thread used job. nothing prevents choosing thread manage threads. main thread can participate in the "work" worker.

each thread manager thread itself?

a thread independent entity within process. usually, "co-ordinate" each other accomplish common goal. can have multiple groups of threads, each group doing different tasks. there doesn't have "manager thread". because thread can independent , exit (pthread_exit) without ever needing communicate others (e.g. each thread sorting separate file). or threads may co-ordinate each other (e.g. matrix multiplication). or may "managed" 1 thread (e.g. main thread "feeding" work others in queue worked on other threads in master/slaves manner).


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -