Micro-Threads: uthreadsleep.py -- scheduling of uthreads to c ontinue processing after given seconds

Mike Fletcher mfletch at tpresence.com
Wed May 24 00:28:47 EDT 2000


My guess would be there will number of sub-classes of this general pattern.
These are currently represented by:
	time.sleep() -- important
	select.select() -- extremely important for network applications
	GUI messages

In the abstract, these are system-level event producers, which, when some
condition is satisfied or a message is received, should restore the given
micro-thread's context.  Note: to work, this requires that the
micro-threading system still be active, and likely that control is returned
to the same operating system thread as originated the call.

As far as I can see, each of these producers will need to be coded in C/C++,
with a constructor taking a pointer to the thread, a pointer to the
continuation, and some number of producer-specific arguments.  On meeting
its requirements/receiving information, the producer should check to see if
the micro-threading system is active for the given operating system thread,
if not, it needs to re-activate the micro-threading system, it should then
add the continuation to the list of tasks. If successful (not canceled
etc.), and can produce multiple events, the producer should re-schedule
itself and return to waiting.

Of course, I haven't a clue how to do this on the C++ side :) , and by the
sounds of it, Just's stuff makes all this obsolete... now I just have to get
my hands on it ;) .

Enjoy,
Mike

-----Original Message-----
From: tismer Kaun [mailto:tismer at tismer.com]
Sent: Tuesday, May 23, 2000 9:03 PM
To: Mike Fletcher
Cc: Python Listserv (E-mail)
Subject: Re: Micro-Threads: uthreadsleep.py -- scheduling of uthreads to
continue processing after given seconds


Howdy Mike, glad that you are in the club :-))

Mike Fletcher wrote:
...

Just's version is already capable to cope with a bunch of real threads,
each one of these running any number of µthreads. Getting this timer
stuff right appears to be a task for myself. Please help me with the
proper design.
...




More information about the Python-list mailing list