c*******v 发帖数: 2599 | 1 golang搞的三层scheduler,没有大面积抱怨,被迫改掉。是非常不容易的。
https://lwn.net./Articles/10465/
the new library is based on an 1-on-1 model. Earlier design
documents stated that an M-on-N implementation was necessary to
support a scalable thread library. This was especially true for
the IA-32 and x86-64 platforms since the ABI with respect to threads
forces the use of segment registers and the only way to use those
registers was with the Local Descriptor Table (LDT) data structure
of the processor.
The kernel limitations the earlier designs were based on have been
eliminated as part of this project, opening the road to a 1-on-1
implementation which has many advantages such as
+ less complex implementation;
+ avoidance of two-level scheduling, enabling the kernel to make all
scheduling decisions;
+ direct interaction between kernel and user-level code (e.g., when
delivering signals);
+ and more and more.
It is not generally accepted that a 1-on-1 model is superior but our
tests showed the viability of this approach and by comparing it with
the overhead added by existing M-on-N implementations we became
convinced that 1-on-1 is the right approach. |
|