Re: [go-nuts] Is there a way to check if all pending finalizers have been executed?

2016-10-16 Thread Ian Lance Taylor
On Sat, Oct 15, 2016 at 12:08 AM, wrote: > > On Saturday, October 15, 2016 at 8:18:04 AM UTC+8, Ian Lance Taylor wrote: >> >> On Fri, Oct 14, 2016 at 4:08 PM, 'Peter Lam' via golang-nuts >> wrote: >> > Is there someway to wait for all pending

Re: [go-nuts] Is there a way to check if all pending finalizers have been executed?

2016-10-16 Thread 'Kevin Malachowski' via golang-nuts
In that case it's generally "better" to have an explicit Close on your Go type which causes the explicit freeing of C memory. This can be tedious depending on your specific code, though. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Is there a way to check if all pending finalizers have been executed?

2016-10-16 Thread Justin Israel
On Sun, 16 Oct 2016, 6:16 PM wrote: > > > On Saturday, October 15, 2016 at 6:37:08 PM UTC+8, Hotei wrote: > > re "meaningfullness" - I think he's saying that a finalizer for a function > called in a goroutine might not run if main() quits first, intentionally or > otherwise.

Re: [go-nuts] Is there a way to check if all pending finalizers have been executed?

2016-10-15 Thread digg
On Saturday, October 15, 2016 at 6:37:08 PM UTC+8, Hotei wrote: > > re "meaningfullness" - I think he's saying that a finalizer for a function > called in a goroutine might not run if main() quits first, intentionally or > otherwise. You can of course check for this specific case by making

Re: [go-nuts] Is there a way to check if all pending finalizers have been executed?

2016-10-15 Thread Dave Cheney
You shouldn't rely on finalisers for the correctness of your program, which is another way of saying, you shouldn't rely on finalisers. Period. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

Re: [go-nuts] Is there a way to check if all pending finalizers have been executed?

2016-10-15 Thread Hotei
re "meaningfullness" - I think he's saying that a finalizer for a function called in a goroutine might not run if main() quits first, intentionally or otherwise. You can of course check for this specific case by making sure all your goroutines are cleaned up before exiting main - but in some

Re: [go-nuts] Is there a way to check if all pending finalizers have been executed?

2016-10-15 Thread digg
On Saturday, October 15, 2016 at 8:18:04 AM UTC+8, Ian Lance Taylor wrote: > > On Fri, Oct 14, 2016 at 4:08 PM, 'Peter Lam' via golang-nuts > wrote: > > Is there someway to wait for all pending finalizers to be run? > > Not in general, no. Conceptually it doesn't

Re: [go-nuts] Is there a way to check if all pending finalizers have been executed?

2016-10-14 Thread Ian Lance Taylor
On Fri, Oct 14, 2016 at 4:08 PM, 'Peter Lam' via golang-nuts wrote: > Is there someway to wait for all pending finalizers to be run? Not in general, no. Conceptually it doesn't make sense since, as you know, finalizers not guaranteed to run at all. You could of

[go-nuts] Is there a way to check if all pending finalizers have been executed?

2016-10-14 Thread 'Peter Lam' via golang-nuts
Is there someway to wait for all pending finalizers to be run? I've looked at the finalizer unittest (https://golang.org/src/runtime/mfinal_test.go?h=SetFinalizer) and it looks like it just waits 4 seconds. Is that best-practice? Is there some deterministic way to wait for all pending