spawn or fork

sjdevnull at yahoo.com sjdevnull at yahoo.com
Wed Dec 8 18:11:40 CET 2004


Eric Brunel wrote:
> > Basically, I have the situation where a user (via the web) requests
data
> > from a database that has to be written to file. However, this takes
a couple
> > of minutes. So the way I thought of doing this is:
> > 1. create an empty file.
> > 2a. tell the user where to look for the file.
> > 2b. spawn a process to insert data into the file.
> >
> > This way the user can see the data as its being written.
>
> You may want to use threads for this instead of processes. See
> http://docs.python.org/lib/module-threading.html

I haven't seen any reason he wants to give up protected memory, so the
only reason to use threads is if the platform doesn't support fork (or
has a broken/nonperformant implementation thereof).




More information about the Python-list mailing list