pthreads - how kernel manage user space threads in linux? -
i have read linux - threads , process
i understood every kernel threads have unique task_struct
but right question how kernel manage user application's thread, suppose user application have 12 thread how kernel manage them , every thread have unique task_struct kernel threads
the kernel manages them when can, ie. whenever entered 'interrupt' changes state of threads.
there 2 flavours of interrupt: either syscall running thread, or call driver has been entered 'real' hardware interrupt kb, nic, disk, timer etc, can change state of threads , initiate sceduling algorithm run may change set of threads run on available cores.
in between interrupts, kernel manages nothing because not entered.
the task_struct raised when running thread makes syscall create new thread. new thread created ready, , run whenever scheduling algorithm dispatches onto core.
Comments
Post a Comment