Re: [go-nuts] Re: deadlock with a empty select{} in main goroutine.

2020-04-08 Thread Aravindhan K
Thanks Ian. Aravindhan K On Thu, Apr 9, 2020 at 3:21 AM Ian Lance Taylor wrote: > On Wed, Apr 8, 2020 at 10:19 AM Aravindhan K > wrote: > > > > If that is the case, in below code main go routine will a reach a > situation where no other go routines running to wake it up. > > But no deadlock is

Re: [go-nuts] Re: deadlock with a empty select{} in main goroutine.

2020-04-08 Thread Ian Lance Taylor
On Wed, Apr 8, 2020 at 10:19 AM Aravindhan K wrote: > > If that is the case, in below code main go routine will a reach a situation > where no other go routines running to wake it up. > But no deadlock is not detected. > https://play.golang.org/p/z1NMYQAi0KY > May I assume deadlock - detection co

Re: [go-nuts] Re: deadlock with a empty select{} in main goroutine.

2020-04-08 Thread Aravindhan K
Thanks all. If that is the case, in below code main go routine will a reach a situation where no other go routines running to wake it up. But no deadlock is not detected. https://play.golang.org/p/z1NMYQAi0KY May I assume deadlock - detection couldn't pick up this scenario? By using empty select{}

Re: [go-nuts] Re: deadlock with a empty select{} in main goroutine.

2020-04-08 Thread 'Vikram Ingawale' via golang-nuts
Hi Manlio , The select statement will block until one of its cases is executed and in your program the select statement doesn't have any cas. so it will block forever and resulting in deadlock Thanks, Vikram Ingawale ph : +91 9766984458 On Wed, Apr 8, 2020 at 9:57 PM Manlio Perillo wrote: >

[go-nuts] Re: deadlock with a empty select{} in main goroutine.

2020-04-08 Thread Manlio Perillo
On Wednesday, April 8, 2020 at 6:17:59 PM UTC+2, aravind...@gmail.com wrote: > > > Hi All, > > I am not able to understand why this piece of go code deadlocks. > Doesn't empty select{} blocks forever, irrespective of other go routines > to wake that up. > > https://play.golang.org/p/zBWZPjTGYX7