Runtime could benefit from OS support for user-mode scheduling.
Namely, UMS on windows:
and switchto domains on linux:
This would allow to determine when a thread in syscall/cgocall actually block. Which
would allow to reduce non-blocking syscall/cgocall overhead by delaying most of the work
till the actual blocking; and to prevent CPU oversubscription by maintaing total of
GOMAXPROCS threads running both Go and C/syscall code.
The obvious downside is increased complexity and lots of OS-specific code.
The text was updated successfully, but these errors were encountered:
maintaining total GOMAXPROCS threading running both go and cgo code
will break at least one misc/cgo/test case though.
However, if we count goroutines running cgo code towards to GOMAXPROCS,
then I think we can dramatically reduce cgocall overhead (no scheduler coordination
except mark that it enters cgocall). Am I correct?
This reverts commit ab4c929.
Sysmon critically depends on system timer resolution for retaking
of Ps blocked in system calls. See #14790 for an example
of a program where execution time goes from 2ms to 30ms if
timeBeginPeriod(1) is not used.
We can remove timeBeginPeriod(1) when we support UMS (#7876).
Reviewed-by: Austin Clements <firstname.lastname@example.org>
Run-TryBot: Dmitry Vyukov <email@example.com>
TryBot-Result: Gobot Gobot <firstname.lastname@example.org>
Reviewed-by: Alex Brainman <email@example.com>