On Wed, Jan 4, 2017 at 12:28 PM, Kritta <benzsk...@gmail.com> wrote: > In other word, Will GC collect this channel for me.
Not with the current implementation. The goroutine will block writing to the channel, and it will sit there using up a small amount of memory until the program exits. It will never call method1. We've considered collecting such goroutines and just saving the stack trace, but nothing has been implemented. Ian > On Thursday, January 5, 2017 at 3:26:07 AM UTC+7, Kritta wrote: >> >> For example, >> >> go func() { >> c <- true //This is blocked cause c is full >> method1() >> } >> >> Others goroutine include main has no reference to 'c', so there're no way >> out for 'c'. >> Questions: >> >> Will method1() be executed and when? >> Will this gorountine released or still there forever? > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.