Python signal delivery under BSD 4.4
Elf M. Sternberg
elf at drizzle.com
Fri Aug 15 17:49:41 CEST 2003
Alex Martelli <aleaxit at yahoo.com> writes:
> Incidentally, these aren't far from the advice in "Pthreads Programming"
> (by Nichols, Buttlar and Proulx Farrell -- O'Reilly) in Chapter 5, under
> "Threads and Process Management". The authors are dealing with C issues,
> not Python by any means, but still they conclude that "forking from a
> multithreaded program is no picnic" and suggest 1) fork before you've
> created any threads, and 2) consider the surrogate parent model (fork a
> child process at init time, IPC with the child -- which remains single
> threaded -- to delegate forking and execing on our behalf).
(1) wasn't really viable since the parent process is ruled by an
application server (Webware, in this case) and I have no desire to go
trolling through the guts of that excellent program to make it "work"
the way I want. I almost went with (2). But, fortunately, we're
developing a single-OS appliance and don't really care about
cross-platform compatibility, so I worked with the FreeBSD 4.4 "model"
of forking from multithreaded applications. It's fortunate that the
next call is an exec(); I'd hate to have to manage a forked copy of the
process with that one thread...
More information about the Python-list