Re: [go-nuts] Do you have to read/write until EGAIN in RawConn.Read/Write?

2019-12-21 Thread Daniel Eloff
On Saturday, December 21, 2019 at 11:33:15 AM UTC-8, Ian Lance Taylor wrote: > > On Sat, Dec 21, 2019 at 7:09 AM Daniel Eloff > wrote: > > > > Digging a little, it seems Go net poller uses edge triggered epoll on > Linux. One of the harder considerations about using

[go-nuts] Do you have to read/write until EGAIN in RawConn.Read/Write?

2019-12-21 Thread Daniel Eloff
Digging a little, it seems Go net poller uses edge triggered epoll on Linux. One of the harder considerations about using edge-triggered epoll is you have to read()/write() until EGAIN, otherwise you will not receive another read/write event for the socket when you call epoll_wait. My question

Re: [go-nuts] Avoiding resource leaks with racing channels

2019-07-09 Thread Daniel Eloff
> > > And not only that, it's complicated. The language spec is not the > right place to dig into the complexities of how to use select safely > while avoiding race conditions. There is just too much to say. And > there are no docs for select other than the language spec. > > Well here's th

Re: [go-nuts] Avoiding resource leaks with racing channels

2019-07-09 Thread Daniel Eloff
> > > In my opinion the best place for this kind of discussion is a blog > post or talk. > I disagree strongly. If there's a mode of operation that's dangerous when I'm operating a car or machinery I want it to not just be called out in the manual, but called attention to in a big bold font.

[go-nuts] Avoiding resource leaks with racing channels

2019-07-08 Thread Daniel Eloff
If a select statement has multiple channels ready when it runs, then it will choose one at a random. So if you fire something across a channel that holds a resource, like an open file descriptor - you have no guarantees that the other end of the channel receives it. The (possibly full) channel