[Stackless] Eliminating Busy Waits and Unnecssary Sleeps

Carlos Eduardo de Paula carlosedp at gmail.com
Wed Aug 8 21:39:41 CEST 2007


Here we have one problem, it doesnt works on windows. Only socket
objects can be "selected" on this platform.

C:\>python
Python 2.5.1 Stackless 3.1b3 060516 (release25-maint:55039:55048, May  1 2007, 1
4:13:4) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import select
>>> select.poll()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'poll'

Carlos


On 8/8/07, seun.osewa at gmail.com <seun.osewa at gmail.com> wrote:
> Hello Edwards,
>
> Hmmm, this reminds me of stacklessfile.py and stacklesssoocket.py.
>
> Can you explain how yours works and show us some sample code?
>
> Thanks and Regards!
>
> On 8/8/07, Edward Faulkner <ef at alum.mit.edu> wrote:
> > Having seen several questions go by lately about how to properly do IO
> > without arbitrary sleeps or busy waits or thread pools, I decided to
> > post some code that others may find helpful.
> >
> > This example does arbitrary IO on both sockets and files, and provides
> > channels with timeouts, without any of the above-mentioned problems.
> > There's nothing to tune, so it just works.
> >
> > The code is here: http://sweetbytes.net/stackless_io.html
> >
> > -Ed
> >
> > _______________________________________________
> > Stackless mailing list
> > Stackless at stackless.com
> > http://stackless.com/cgi-bin/mailman/listinfo/stackless
> >
>
>
> --
> Seun Osewa
> http://www.nairaland.com [vast Nigerian forum]
>
> _______________________________________________
> Stackless mailing list
> Stackless at stackless.com
> http://stackless.com/cgi-bin/mailman/listinfo/stackless
>


-- 
-------------------------------------------------------------------
Visit Stackless Examples Project
http://code.google.com/p/stacklessexamples/
Stackless Python - www.stackless.com
-------------------------------------------------------------------

_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://stackless.com/cgi-bin/mailman/listinfo/stackless



More information about the Stackless mailing list