M2Crypto: select() behaves weird on SSL sockets

Irmen de Jong irmen at NOSPAMREMOVETHISxs4all.nl
Thu Jun 27 18:33:06 EDT 2002


Kragen Sitaker wrote:

> There are many pieces of middle ground between complete threading (two
> threads per connection) and complete event-loop-drivenness with just
> one thread --- as you're obviously aware, since you're using select()
> in a threaded program.

Um, yeah. I have 1 loop using select() that waits for new incoming
connections. Every thread that is started for a connection just
recv()s data off the socket.

> What I guess you're not aware of is that asyncore supports the middle
> ground (middle colors?) as well as the event-loop-driven end of the
> spectrum.  For example, Zope has an asyncore thread that handles I/O,
> but actually processes requests and produces results in some child
> threads.

You're probably right. I don't know a lot about the workings of asyncore.
Perhaps if I finally squash the bug that is still in Pyro 3
-- *blushes* it's probably a threading race condition -- I'll spend
some time looking at it.

Doing stuff the Zope way, the worker threads must have some way to
get to the input and output streams that are handled in asyncore, right?


Irmen






More information about the Python-list mailing list