Re: [go-nuts] Are M always detached from P when syscall?

2019-11-15 Thread Ian Lance Taylor
On Fri, Nov 15, 2019 at 7:27 PM Vincent Blanchon wrote: > > I was wondering about the behavior of syscalls. It looks like Go always wraps > syscall - whatever blocking or not - with calling entersyscallblock() and > exitsyscall() later. The first one automatically detaches M from the P when >

Re: [go-nuts] Are M always detached from P when syscall?

2019-11-15 Thread Robert Engels
I’m pretty sure that if you look deeper not every call ends in “blocking” at least at the os level. Go uses green threads and relies on os level “poll type” support. It has the overhead of its own scheduler but in most cases it is more efficient than the os one. > On Nov 15, 2019, at 9:52 PM,

Re: [go-nuts] Are M always detached from P when syscall?

2019-11-15 Thread Kurtis Rader
On Fri, Nov 15, 2019 at 7:27 PM Vincent Blanchon wrote: > I was wondering about the behavior of syscalls. It looks like Go always > wraps syscall - whatever blocking or not - with calling entersyscallblock() > and exitsyscall() later. The first one automatically detaches M from the P > when

[go-nuts] Are M always detached from P when syscall?

2019-11-15 Thread Vincent Blanchon
Hello, I was wondering about the behavior of syscalls. It looks like Go always wraps syscall - whatever blocking or not - with calling entersyscallblock() and exitsyscall() later. The first one automatically detaches M from the P when exit tries to acquire the same P or move the G to the