As written, virtual threads are eventually mapped to actual threads. Let's say there are 1 million virtual threads that are created. In a 8 core processor, I assume there will be 8 kernel threads. So, my questions are
Mapping of virtual threads and kernel threads is done by the thread model. There are 3 kinds of thread models available
Essentially, the thread library keeps a mapping between the user threads/ virtual threads to kernel threads.
Additionally, creating a kernel thread requires creating a complete thread control block so that kernel can manage those threads. This process is again slow.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.