LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   can pthread be preemptive ? (https://www.linuxquestions.org/questions/linux-newbie-8/can-pthread-be-preemptive-4175553615/)

david_8274 09-16-2015 12:08 AM

can pthread be preemptive ?
 
Hi all,

I have read about that pthread (or in general, userland threads) are cooperative. Is it true? Is there a "preemptive mode" for pthread?

Thanks,
Wei Xu

jpollard 09-16-2015 06:51 AM

On linux (using pthreads) they are treated as separate processes.

You can see that using "ps -eLf", "ps axms" or "top -H". Each thread is scheduled independently by the kernel.


All times are GMT -5. The time now is 04:30 PM.