On Sun, 13 Dec 1998, Paul Everitt wrote:
Presumably on Linux, right? Want to share the details of your kernel versions, etc. and any lessons you learned along the way? Developed on a RH5.1 (in reality a RH5.x with x some float between 1 and 2, I'm usually upgrading systems partially without disturbing the uptime :) )
Deployed on a Suse 5.3 with a statically compiled python (the python was compiled statically on a RH5.x box). Lessons: -) Python 1.5.1 seems to report exceptions in threads via C language mechanism (at least the first line, ``Unexpected exception ...''. So I'm using the following SaveThread class: class SaveThread(threading.Thread): savethread=1 def run(self): try: threading.Thread.run(self) except SystemExit: raise except: import CGIResponse r=CGIResponse.Response() exp=sys.exc_info() res=r.format_exception(exp[0],exp[1],exp[2]) logger("loggerSupport>SaveThread/run:exception",string.joinfields(re s,"\n")) -) Mixing lowlevel threads and hilevel threads (threading module) works, but generates many Dummy Thread objects that cannot do a thing :( So probably stick with one of these two :) -) There are a number of cool things that one can do once one started to use threads, like DebuggingServer (more or less a Python shell that is executed inside the LRP), ... -) One thing to look out is, that on Linux/glibc2 each pthread seems to use up one file descriptor. (Not so cool in my application that soaks up filedescriptors quite fast :( ) One a side note, fork() and sys.exit() do not coexist peacefully it seems with pcgi, while fork() and exec() do so. I guess pcgi is overwriting sys.exit and shutdowns the LRP when one of the childs calls sys.exit :( Andreas -- Win95: n., A huge annoying boot virus that causes random spontaneous system crashes, usually just before saving a massive project. Easily cured by UNIX. See also MS-DOS, IBM-DOS, DR-DOS, Win 3.x, Win98.