A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-December/084494.html below:

[Python-Dev] extremely slow exit for program having huge (45G) dict (python 2.5.2)

[Python-Dev] extremely slow exit for program having huge (45G) dict (python 2.5.2) [Python-Dev] extremely slow exit for program having huge (45G) dict (python 2.5.2)Andrew Bennetts andrew-pythondev at puzzling.org
Sun Dec 21 01:15:30 CET 2008
skip at pobox.com wrote:
> 
>     Steve> Unfortunately there are doubtless programs out there that do rely
>     Steve> on actions being taken at shutdown.
> 
> Indeed.  I believe any code which calls atexit.register.
> 
>     Steve> Maybe os.exit() could be more widely advertised, though ...
> 
> That would be os._exit().  Calling it avoids calls to exit functions
> registered with atexit.register().  I believe it is both safe, and
> reasonable programming practice for modules to register exit functions.
> Both the logging and multiprocessing modules call it.  It's incumbent on the
> application programmer to know these details of the modules the app uses
> (perhaps indirectly) to know whether or not it's safe/wise to call
> os._exit().

You could call sys.exitfunc() just before os._exit().

-Andrew.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4