Re: [Pyobjc-dev] Threading
Brought to you by:
ronaldoussoren
From: Tony L. <ton...@lo...> - 2003-01-21 00:56:29
|
At 6:59 PM -0500 1/20/03, Bob Ippolito wrote: >On Monday, Jan 20, 2003, at 18:50 America/New_York, Tony Lownds wrote: >>Any advice on writing a pyobjc program that uses threads? > >My best suggestion is simply don't :) Heh. Its been a good way to force myself up the pyobjc learning curve. >Check out Twisted ( http://www.twistedmatrix.com/ ).. In CVS HEAD >Twisted/doc/examples I have a demo on how you would (in a sort of >ghetto polling way) tie a Twisted application into a pyobjc >frontend. It's an asynchronous multi-protocol communications >framework that doesn't suck (like medusa). It never threads unless >it really needs to (i.e. RDBMS interaction, and certain things in >win32 and jython). Thanks, I'll check that out. I'm aiming for a thin integration over an existing project. The fewer changes to the server code, the better. It uses asyncore, porting to twisted would probably involve too many changes for my current goals. BTW, python 2.2 from Apple does not appear to have poll() - does twisted work on python 2.2 from Apple? >If you have any questions post it to the twisted dev list, #twisted >in freenode.net, or you could ask me. > >I've developed a system for doing Twisted code using Python 2.2's >generators that allows you to write Twisted code in a very similar >way to how you would write blocking threaded code (with the caveat >that you should yield a sleep(0) or cooperate command if you're >doing some heavy computation) Thanks! -Tony |