Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-29 Thread Michael Jones
"endeavor to" "anticipate" "allow for" "prepare for" "encourage" "facilitate" ...good "ensure" / "force" / "guarantee" (not in your control) "reclaim" / "recycle" / "release" (too absolute) ...bad On Sun, Jan 29, 2017 at 4:51 PM, Val wrote: > Hello Jesper > if I

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-29 Thread Val
Hello Jesper if I understand this thread correctly, "make sure" should be rephrased by "make extra efforts for ...". Sorry for nitpicking (not trying to look pedantic or arrogant) Val On Sunday, January 29, 2017 at 4:28:09 PM UTC+1, Jesper Louis Andersen wrote: > > > you'd like to eventually

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-29 Thread Jesper Louis Andersen
On Sat, Jan 28, 2017 at 10:22 PM John Souvestre wrote: > > If finalizers were indeed totally useless, it would obviously be totally > useless to implement support for them. > > If someone described a few cases where finalizers were useful perhaps it > would help understand

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread 'Axel Wagner' via golang-nuts
There are a bunch of examples of where they are *useful* (some in this thread). It's just, that you can not *rely* on them for correctness. If you are setting a finalizer, because something needs to happen before some value gets GCed/falls out of scope, you are doing it wrong, don't do it. If you

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread Justin Israel
On Sun, Jan 29, 2017, 10:35 AM John Souvestre wrote: > > If you find a piece of code that uses a finaliser for the correct > operation of that program, that code is broken. > > Does that include using a finalizer with CGO code? From what I read, that > seems to be where

RE: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread John Souvestre
> If you find a piece of code that uses a finaliser for the correct operation > of that program, that code is broken. Does that include using a finalizer with CGO code? From what I read, that seems to be where they are most often used. >

RE: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread John Souvestre
> If finalizers were indeed totally useless, it would obviously be totally useless to implement support for them. If someone described a few cases where finalizers were useful perhaps it would help understand them. John John Souvestre - New Orleans LA -- You received this message

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread Dave Cheney
If you find a piece of code that uses a finaliser for the correct operation of that program, that code is broken. -- 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

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread T L
On Sunday, January 29, 2017 at 1:04:35 AM UTC+8, Axel Wagner wrote: > > On Sat, Jan 28, 2017 at 4:05 PM, T L > wrote: > >> >> >> On Saturday, January 28, 2017 at 10:46:50 PM UTC+8, Dave Cheney wrote: >>> >>> >>> >>> On Sunday, 29 January 2017 01:42:08 UTC+11, T L wrote:

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread 'Axel Wagner' via golang-nuts
On Sat, Jan 28, 2017 at 4:05 PM, T L wrote: > > > On Saturday, January 28, 2017 at 10:46:50 PM UTC+8, Dave Cheney wrote: >> >> >> >> On Sunday, 29 January 2017 01:42:08 UTC+11, T L wrote: >>> >>> >>> >>> On Saturday, January 28, 2017 at 10:33:08 PM UTC+8, Dave Cheney wrote:

Re: [go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread Konstantin Khomoutov
On Sat, 28 Jan 2017 07:05:13 -0800 (PST) T L wrote: [...] > My understanding is finalisers are guaranteed to run for some cases, > but not for some other cases, for a long running program. > If any cases are not guaranteed to run, then SetFinalizer would be > totally

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread T L
On Saturday, January 28, 2017 at 10:46:50 PM UTC+8, Dave Cheney wrote: > > > > On Sunday, 29 January 2017 01:42:08 UTC+11, T L wrote: >> >> >> >> On Saturday, January 28, 2017 at 10:33:08 PM UTC+8, Dave Cheney wrote: >>> >>> >>> >>> On Sunday, 29 January 2017 01:25:20 UTC+11, T L wrote:

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread Dave Cheney
On Sunday, 29 January 2017 01:42:08 UTC+11, T L wrote: > > > > On Saturday, January 28, 2017 at 10:33:08 PM UTC+8, Dave Cheney wrote: >> >> >> >> On Sunday, 29 January 2017 01:25:20 UTC+11, T L wrote: >>> >>> >>> >>> On Saturday, January 28, 2017 at 9:33:51 PM UTC+8, C Banning wrote:

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread T L
On Saturday, January 28, 2017 at 10:33:08 PM UTC+8, Dave Cheney wrote: > > > > On Sunday, 29 January 2017 01:25:20 UTC+11, T L wrote: >> >> >> >> On Saturday, January 28, 2017 at 9:33:51 PM UTC+8, C Banning wrote: >>> >>> From the doc: "The finalizer for obj is scheduled to run at some >>>

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread T L
On Saturday, January 28, 2017 at 10:25:20 PM UTC+8, T L wrote: > > > > On Saturday, January 28, 2017 at 9:33:51 PM UTC+8, C Banning wrote: >> >> From the doc: "The finalizer for obj is scheduled to run at some >> arbitrary time after obj becomes unreachable. There is no guarantee that >>

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread Dave Cheney
On Sunday, 29 January 2017 01:25:20 UTC+11, T L wrote: > > > > On Saturday, January 28, 2017 at 9:33:51 PM UTC+8, C Banning wrote: >> >> From the doc: "The finalizer for obj is scheduled to run at some >> arbitrary time after obj becomes unreachable. There is no guarantee that >> finalizers

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread T L
On Saturday, January 28, 2017 at 9:33:51 PM UTC+8, C Banning wrote: > > From the doc: "The finalizer for obj is scheduled to run at some > arbitrary time after obj becomes unreachable. There is no guarantee that > finalizers will run before a program exits, so typically they are useful > only

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread T L
On Saturday, January 28, 2017 at 9:33:51 PM UTC+8, C Banning wrote: > > From the doc: "The finalizer for obj is scheduled to run at some > arbitrary time after obj becomes unreachable. There is no guarantee that > finalizers will run before a program exits, so typically they are useful > only

[go-nuts] Re: I know finalizers are not promised to be called, but is it too not promised?

2017-01-28 Thread C Banning
>From the doc: "The finalizer for obj is scheduled to run at some arbitrary time after obj becomes unreachable. There is no guarantee that finalizers will run before a program exits, so typically they are useful only for releasing non-memory resources associated with an object during a