From: Gabe W. <gw...@wa...> - 2002-05-26 18:40:47
|
It was pointed out to me that SEDA [1] might not be a great advantage in Python given Python's global interpreter lock and the way it switches between threads (ie every ten bytecodes) [2]. I've been thinking about this a bit and I've decided that we should move forward with a SEDA-based implementation for the following reasons: 1) I think there is still an advantage for non-os threads or even the GIL situation in python w/r/t tuning of threads under heavy load, as well as debugging and monitoring (and unit testing, btw!!!) 2) There is always Stackless Python which may have interesting interactions with SEDA on its own 3) If this is done right, most of the coding will be event-handlers which means that the threading model can be SEDA, single (or fixed number) threads, or even fully multithreaded. And it should be *pluggable* (ie configurable at runtime). Thats actually quite cool,if one thinks about it. 4) Profile implementations are going to be implemented with event handlers no matter what anyway, and functionality exposed by the library will be exposed through an API which will hide any event-architecture specifics. Thoughts are *greatly* welcomed, though I expect work to commence quite soon on the event architecture refactoring. I think this will speed up development quite a bit, and will make both unit and functional testing much easier. -Gabe [1] http://www.cs.berkeley.edu/~mdw/proj/seda/ [2] http://www.python.org/doc/current/api/threads.html On Fri, 24 May 2002, Gabe Wachob wrote: > > I checked in the beginning of a SEDA-inspired framework today (in > lib/seda.py) > > It sorta actually works. Doesn't do everything SEDA yet - and it does a > polling to manage threads (which sucks - should be event based itself). > Also, "Stages" can only have one incoming sink (which might be all we need > for pybeep). > > Take a look. Its far from tested... > > -Gabe > > -- Gabe Wachob gw...@wa... Personal http://www.wachob.com Founder, WiredObjects http://www.wiredobjects.com |