On Wed, Feb 27, 2008 at 3:46 AM, <
glyph@divmod.com> wrote:
On 11:11 am,
coder_gus@lavabit.com wrote:
>So, my question is: is this kind of architecture good to implement?
>(asynchronous server and threaded workers)
You might want to consider using process workers instead of thread
workers, using spawnProcess and a simple control protocol. This is
easier to debug, since threads are painful to figure out, and it also
scales better - you escape python's GIL and can take advantage of
multiple cores, but even if it weren't for that, you can switch
spawnProcess to some kind of remote connection API and run your
processes remotely.
Would you say that this method of using a separate process instead of
threads to do work also is possibly good for database operations?
I'm always reading 'beware of threads' ;) with respect to Twisted,
so using a very simple control protocol to manage a separate
dedicate database process might be better than
relying on the threading that 'adbapi' uses?
Any comments on this would be appreciated.
Thanks,
-Alex