<skip <at> pobox.com> writes:
> 
> I don't understand.  On Unix-y systems isn't spawn* layered on top of
> fork/exec?

The point is that exec() relinquishes all the existing resources, so the initial
fork() becomes an implementation detail (IIUC).

> If you were going to
> combine both threading and multiprocessing it seems much more logical to me
> to fork first (coarse-grained subdivision) then create threads (finer
> grained threads of control) in those processes.

It depends what you're doing. For example, if you're running an event loop in
your main thread, you will want to first spawn a worker thread before doing any
kind of blocking communication with any child processes you spawn.

There's also, as already stated, the situation where threads are launched behind
your back by a third-party library.

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to