Re: [go-nuts] Using default in select causes a deadlock

2018-10-24 Thread Burak Serdar
On Wed, Oct 24, 2018 at 11:17 AM Sathish VJ wrote: > > Thank you. Would you have an explanation for why it works so differently > from using default? The codepath that causes the deadlock is : - main reads from c - f() runs select, quit is not writable, so selects default, which starts waitin

Re: [go-nuts] Using default in select causes a deadlock

2018-10-24 Thread Sathish VJ
Thank you. Would you have an explanation for why it works so differently from using default? On Wednesday, 24 October 2018 22:44:26 UTC+5:30, Burak Serdar wrote: > > You can do this instead: > > https://play.golang.org/p/avMIyYlwxbF > On Wed, Oct 24, 2018 at 11:05 AM Sathish VJ > wrote: > >

Re: [go-nuts] Using default in select causes a deadlock

2018-10-24 Thread Burak Serdar
You can do this instead: https://play.golang.org/p/avMIyYlwxbF On Wed, Oct 24, 2018 at 11:05 AM Sathish VJ wrote: > > This is a program where the receiver is asking the sender to close after > receiving 1 value. Using default for the sending (line 34) causes the code > to deadlock while even a

[go-nuts] Using default in select causes a deadlock

2018-10-24 Thread Sathish VJ
This is a program where the receiver is asking the sender to close after receiving 1 value. Using default for the sending (line 34) causes the code to deadlock while even a timeout of a nanosecond causes it to be ok. I don't want to time the sending though. Is there a better option to sequen