News for hackers. Stuff that matters.
Re:On Go, Portability, and System Interfaces by teacup50 on Tuesday September 22, 2015 @07:45PM (#10262503)
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.

Re:On Go, Portability, and System Interfaces by pjc50 on Wednesday September 23, 2015 @09:39AM (#10264895)
I'm assuming you mean "unsupported" rather than "prohibited by law", although with the DMCA one can never be sure.
Re:On Go, Portability, and System Interfaces by 4ad on Tuesday September 22, 2015 @08:13PM (#10262596)
On Windows and Solaris, Go doesn't do its own syscalls.
Re:On Go, Portability, and System Interfaces by teacup50 on Tuesday September 22, 2015 @08:16PM (#10262607)
How about OS X?

(and, how does that work when calling into userspace APIs that assume fixed 1:1 thread/stack correlation)

Re:On Go, Portability, and System Interfaces by 4ad on Tuesday September 22, 2015 @08:25PM (#10262631)
On 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).