comp.lang.ada
 help / color / mirror / Atom feed
From: Jerry <lanceboyle@qwest.net>
Subject: Re: ANN: PLplot plotting library with Ada bindings
Date: Mon, 21 Oct 2013 21:20:13 -0700 (PDT)
Date: 2013-10-21T21:20:13-07:00	[thread overview]
Message-ID: <46f45da1-4cb9-4fbf-a055-d4a9f6693dc6@googlegroups.com> (raw)
In-Reply-To: <l3sqn7$rkp$1@loke.gir.dk>

On Friday, October 18, 2013 7:27:50 PM UTC-7, Randy Brukardt wrote:
> "Jerry"  wrote in message 
> On Tuesday, October 1, 2013 5:45:57 PM UTC-7, Jeffrey Carter wrote:
> > On 10/01/2013 05:31 PM, Jerry wrote:
> ...
> >>  >     ...
> >> >     End_PLplot;        -- Call this only once.
> >>
> >> Why not use finalization to do this?
> >
> >...
> >I don't know what happens if the library doesn't get finalized but it 
> >probably ties up
> >resources so an automatic process would be wise in that sense.
> 
> The problem with requiring manual finalization is that it doesn't work when 
> the program propagates an exception. In that case, the user's explicit call 
> doesn't get executed. You could try to require them to handle such 
> exceptions and do the finalization in a handler, but that's both a mess and 
> something that's easy to forget. And even that doesn't work in the face of 
> abort (although that's probably not a significant concern in this case).
> 
> Thus, I think you always want automatic finalization if any is needed. It 
> might make sense to also support a manual version (especially in this case, 
> where you wouldn't want to force an incompatibility on any of your users, 
> which you would if you completely got rid of the End_PLPlot routine.) -- but 
> you don't want that manual version to be required. (Of course, this assumes 
> that the finalization actually does something important; if the OS cleans up 
> well enough after an program that terminated unexpectedly, then this doesn't 
> apply.)
> 
> Even if *correct* programs would be fine with manual finalization, remember 
> that the program will fail many times while you're creating and debugging 
> it. You don't want that to suck up resources on the user's computer.
> 
>                                   Randy.

Good point. Thanks, Randy. I think I'll work this into the next release.
Jerry

  reply	other threads:[~2013-10-22  4:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-02  0:31 ANN: PLplot plotting library with Ada bindings Jerry
2013-10-02  0:45 ` Jeffrey Carter
2013-10-03  4:39   ` Anatoly Chernyshev
2013-10-03  5:27     ` Jeffrey Carter
2013-10-04 23:55   ` Jerry
2013-10-19  2:27     ` Randy Brukardt
2013-10-22  4:20       ` Jerry [this message]
2013-11-12 15:27 ` Graham Stark
2013-11-13 22:51   ` Jerry
2013-11-15  5:16   ` Jerry
2013-11-18 15:11     ` Graham Stark
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox