Twisted: 1 thread in the reactor pattern

jacopo jacopo.pecci at
Wed Sep 23 08:08:10 CEST 2009

I am diving into Twisted and Perspective Broker (PB) in particular and
I would like to understand more about what happens behind the
Say I have a client and a server on two different machines, the server
gets callRemote()’s in an asynchronous way, these requests are parked
in a queue and then served sequentially (not in parallel – correct me
if I am wrong). If everything is implemented in a single thread, how
is it possible that while the processor is engaged in the processing
triggered by  callRemote()’s at the same time the reactor is ready to
listen/accept new events and put them in a queue? To me it looks like
there should be at least 2 processes, one for the reactor and on for
the rest.
In the documentation they keep stressing how one of the peculiarity of
the reactor pattern is the single thread, but I can not figure out

Any suggestion would be welcome.
For the time being I recommend this doc which has been the most useful
to me so far.

Thanks, Jacopo

More information about the Python-list mailing list