Microthreads: wait( duration ) with minimal processor overhead, u thread6.py

Mike Fletcher mfletch at tpresence.com
Fri May 26 17:15:07 EDT 2000

Attached find uthread6.py (modified version of Just's uthread4.py).  This
adds a mechanism for putting micro-threads to sleep (with minimal processor
overhead), both when other micro-threads are running and when only sleeping
threads are present.  Module passes the included tests, but hasn't had any
significant other testing.

Should allow for having many thousands of paused items with very low
overhead.  Not as good as a system that can accept generic system events,
but it should keep micro-threads from always pegging the processor in
low-load conditions (such as watching ports).  Note: there's a lot of
overhead currently in adding a wait-ed thread.  Micro-pauses may wind up
chewing more power than just letting the system run.  Optimisations welcome.


-----Original Message-----
From: Just van Rossum [mailto:just at letterror.com]
Sent: Wednesday, May 24, 2000 3:29 AM
To: Mike Fletcher; 'tismer Kaun'
Cc: Python Listserv (E-mail)
Subject: RE: Micro-Threads: uthreadsleep.py -- scheduling of uthreads to
c ontinue processing after given seconds

Oh, for those of you interested in the latest uthread module, I've 
put a copy here:



-------------- next part --------------
A non-text attachment was scrubbed...
Name: uthread6.py
Type: application/octet-stream
Size: 33329 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20000526/9e481221/attachment.obj>

More information about the Python-list mailing list