Is Pthread library actually a user thread solution?

后端 未结 6 1718
长情又很酷
长情又很酷 2020-12-04 06:59

The title might not be clear enough because I don\'t know how to define my questions actually.

I understand Pthread is a thread library meeting POSIX standard (about

6条回答
  •  我在风中等你
    2020-12-04 07:27

    @paulsm4 I am doubtful about your comment that kernel knows every thing. In this particular context of user level threads, the kernel is unaware of the fact that such a thing is happening. A user level thread's scheduling is maintained by the user himself (via the interface provided by a library) and the kernel ends up allotting just a single kernel thread to the whole process. Kernel would treat the process as a single threaded and any blocking call by one of the threads would end up blocking all the threads of that process. Refer to http://www.personal.kent.edu/~rmuhamma/OpSystems/Myos/threads.htm

提交回复
热议问题