Re: [go-nuts] epoll: why write 1 byte to the pipe in netpollBreak() and read up to 16 bytes in netpoll()?

2023-08-14 Thread metronome
Hi Ian, Thanks for clarifying, yes it's no harm to leave the code untouched. On Tuesday, August 15, 2023 at 3:21:57 AM UTC+8 Ian Lance Taylor wrote: > On Mon, Aug 14, 2023 at 11:28 AM metronome wrote: > > > > >> If several different goroutines decide to wake up the polling > > >> goroutine

Re: [go-nuts] epoll: why write 1 byte to the pipe in netpollBreak() and read up to 16 bytes in netpoll()?

2023-08-14 Thread Ian Lance Taylor
On Mon, Aug 14, 2023 at 11:28 AM metronome wrote: > > >> If several different goroutines decide to wake up the polling > >> goroutine before the polling goroutine wakes up, they will each write > >> a single byte > > Wondering, with the introduction of "netpollWakeSig", does it still hold >

Re: [go-nuts] epoll: why write 1 byte to the pipe in netpollBreak() and read up to 16 bytes in netpoll()?

2023-08-14 Thread metronome
>> If several different goroutines decide to wake up the polling >> goroutine before the polling goroutine wakes up, they will each write >> a single byte Wondering, with the introduction of "netpollWakeSig", does it still hold true? Thanks. On Tuesday, July 11, 2023 at 9:00:36 AM UTC+8 Ian

Re: [go-nuts] epoll: why write 1 byte to the pipe in netpollBreak() and read up to 16 bytes in netpoll()?

2023-07-10 Thread Ian Lance Taylor
On Mon, Jul 10, 2023 at 6:10 AM shaouai wrote: > > In the implementation of the Go netpoller, `netpollBreak()` attempts to write > 1 byte to `netpollBreakWr`, whereas `netpoll()` reads up to 16 bytes from > `netpollBreakRd`, why 16 bytes rather than 1 byte? > > write up to 1 byte: >

[go-nuts] epoll: why write 1 byte to the pipe in netpollBreak() and read up to 16 bytes in netpoll()?

2023-07-10 Thread shaouai
In the implementation of the Go netpoller, `netpollBreak()` attempts to write 1 byte to `netpollBreakWr`, whereas `netpoll()` reads up to 16 bytes from `netpollBreakRd`, why 16 bytes rather than 1 byte? write up to 1 byte: