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/2017-March/147526.html below:

[Python-Dev] why multiprocessing use os._exit

[Python-Dev] why multiprocessing use os._exit [Python-Dev] why multiprocessing use os._exitTao Qingyun qingyun.tao at tophant.com
Thu Mar 2 23:51:59 EST 2017
in multiprocessing/forking.py#129, `os._exit` cause child process don't close open
file. For example:

```
    from multiprocessing import Process

    def f():
        global log  # prevent gc close the file
        log = open("info.log", "w")
        log.write("***hello world***\n")

    p = Process(target=f)
    p.start()
    p.join()

```
and the `info.log` will be empty. why not use sys.exit ? 


Thanks


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