[Stackless] Stackless socket module

Richard Tew richard.m.tew at gmail.com
Thu Sep 23 06:28:52 CEST 2010


Hi,

This now passes all the socket unit tests, and additionally, it passes
all the xmlrpc unit tests.

The remaining UDP socket unit test failures were because of
unnecessary checks on connectivity in the recv method wrapper.  These
tests passed fine once those checks were removed, any similar
constraints will be enforced in the underlying call to the real
socket's recv method when it is actually done.

The only real change required for getting the xmlrpc unit tests to
pass, was to add __enter__ and __exit__ methods to the
"stacklessthread.py" Lock replacement object, so that it would
properly proxy usage in a with statement to the real lock object.

CAVEAT:

Just because "stacklesssocket.py" passes these tests, does not mean
that you can use it for anything which these tests do with no extra
work.

These tests do a lot of thread blocking activities (time.sleep,
threading.Lock, select.select calls.. etc) that
"stacklesssocket_unittest.py" installs special scheduler compatible
versions of, using "stacklessthread.py", to offload those activities
to secondary threads.  This of course opens up the potential for race
conditions in logic which does not expect this, and additional special
handling is required to recover from that.

Cheers,
Richard.



More information about the Stackless mailing list