Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #29007 > unrolled thread

Some questions about atexit

Started byRoy Smith <roy@panix.com>
First post2012-09-12 20:58 -0400
Last post2012-09-13 09:03 -0400
Articles 3 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  Some questions about atexit Roy Smith <roy@panix.com> - 2012-09-12 20:58 -0400
    Re: Some questions about atexit Terry Reedy <tjreedy@udel.edu> - 2012-09-12 22:29 -0400
      Re: Some questions about atexit Roy Smith <roy@panix.com> - 2012-09-13 09:03 -0400

#29007 — Some questions about atexit

FromRoy Smith <roy@panix.com>
Date2012-09-12 20:58 -0400
SubjectSome questions about atexit
Message-ID<roy-68612B.20582312092012@news.panix.com>
The atexit docs (http://docs.python.org/library/atexit.html) are very 
confusing.  In one place they say, "The order in which the functions are 
called is not defined".  In another place, "all functions registered are 
called in last in, first out order".  Which is correct?

Also, it's not clear how atexit handlers interact with threading.  Do 
all handlers get called in the main thread?  What if some other thread 
registers a handler?  Does it get called in that thread?

[toc] | [next] | [standalone]


#29009

FromTerry Reedy <tjreedy@udel.edu>
Date2012-09-12 22:29 -0400
Message-ID<mailman.587.1347503376.27098.python-list@python.org>
In reply to#29007
On 9/12/2012 8:58 PM, Roy Smith wrote:
> The atexit docs (http://docs.python.org/library/atexit.html) are very
> confusing.  In one place they say, "The order in which the functions are
> called is not defined".  In another place, "all functions registered are
> called in last in, first out order".  Which is correct?

Check the tracker (bugs.python.org) for atexit issues, open and closed. 
I believe there was one about order and whether to make a guarantee. The 
doc might have been changed one place and not another. The newer 
statement is probably correct. In any case, the wrong place should be 
corrected.

> Also, it's not clear how atexit handlers interact with threading.  Do
> all handlers get called in the main thread?  What if some other thread
> registers a handler?  Does it get called in that thread?

Don't know about this.

-- 
Terry Jan Reedy

[toc] | [prev] | [next] | [standalone]


#29029

FromRoy Smith <roy@panix.com>
Date2012-09-13 09:03 -0400
Message-ID<roy-D30833.09034313092012@news.panix.com>
In reply to#29009
In article <mailman.587.1347503376.27098.python-list@python.org>,
 Terry Reedy <tjreedy@udel.edu> wrote:

> On 9/12/2012 8:58 PM, Roy Smith wrote:
> > The atexit docs (http://docs.python.org/library/atexit.html) are very
> > confusing.  In one place they say, "The order in which the functions are
> > called is not defined".  In another place, "all functions registered are
> > called in last in, first out order".  Which is correct?
> 
> Check the tracker (bugs.python.org) for atexit issues, open and closed. 

Thanks for the pointer.  The operative one seems to be 
http://bugs.python.org/issue15233

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web