[Stackless] stacklessocket with threads, and stacklessfile

Carlos Eduardo de Paula carlosedp at gmail.com
Wed Aug 8 20:36:18 CEST 2007

Hi Alec,

I created the stacklessfile module based on some ideas from
threadpools and twisted. For me it worked nice... one thing that is
needed is the tuning for the quantity of worker threads needed.

I tried to implement an automatic allocator and deallocator for the
workers but found out that there is no "one size fits all" solution.

Now I started working on a module for IO using ctypes and windows
overlapped capability where I can get rid of the OS threads. Iqm
facing a problem where I do a  busy wait on the completion function
and it consumes a lot of cpu. I just posted it right now.. if anyone
could take a look and suggest changes i would be glad.

Its here: http://dpaste.com/hold/16368/



On 8/8/07, Alec Flett <alecf at flett.org> wrote:
> Hey folks -
> So we're using stacklessocket with an app that is somewhat CPU intense, but
> also does I/O. We're trying to use stackless socket, but what we're actually
> finding is that overall performance is suffering because of the somewhat
> long wait time in the asynccore runner tasklet. ( 0.05) - if we block for
> more than 0.05 seconds, this ends up wasting about 5% of of our CPU.
> We can certainly play with that number to find out what's optimal for our
> particular application, but I'm curious if anyone has thought about taking
> the same approach that stacklessfile does of having a pool of worker threads
> so that real hardware threads can go into a more effective blocking state?
> And in that case, I wonder if some generalized socket/file replacement would
> be even more helpful.
> I'm especially curious how well the stacklessfile approach has worked for
> people? Does it perform?
>  Alec
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://stackless.com/cgi-bin/mailman/listinfo/stackless

Visit Stackless Examples Project
Stackless Python - www.stackless.com

Stackless mailing list
Stackless at stackless.com

More information about the Stackless mailing list