3 ms·
However, calling directly into the syscall interface is illegal on most platforms other than Linux. I'm not sure Go can fix this without getting rid of their M
by teacup50 11y ago
However, calling directly into the syscall interface is illegal on most platforms other than Linux.
I'm not sure Go can fix this without getting rid of their M:N threading.
- 4ad 11y agoOn Windows and Solaris, Go doesn't do its own syscalls.
- teacup50 11y agoHow about OS X? (and, how does that work when calling into userspace APIs that assume fixed 1:1 thread/stack correlation)
- 4ad 11y agoOn OS X Go does its own system calls, ignoring the OS X guidlines. Go uses M:N scheduling, but you still have N threads with (relatively) large stacks. When calling into C code, Go switches stacks, so it runs on the (relatively) large stack where C code can run. Of course there's some overhead associated with this, but system call overhead is large on its own compared to this anyway. During the system call the thread (obviously) can't run any other Go code, but that's ok, the runtime makes sure there are always threads available to run user Go code (that's one reason why the runtime stands between user code and system calls).
- deleted 11y ago[deleted]
- pjc50 11y agoI'm assuming you mean "unsupported" rather than "prohibited by law", although with the DMCA one can never be sure.