a simple example of Stackless Python

Mike Fletcher mfletch at tpresence.com
Thu Nov 2 02:53:28 CET 2000


Stackless has support for "timeslicing", see the various uthread modules
(lightweight threading ("micro-threads")) for code which uses this mechanism
to create thread-like structures.  Not sure why you'd rather write your own
than implement on top of micro-threads, we're always open to new submissions
that improve the library.

Micro-threads modules are available through:
	http://world.std.com/~wware/uthread.html
or, for uthread9.py, directly at:
	http://members.home.com/mcfletch/programming/uthread9.py

Enjoy yourself,
Mike

-----Original Message-----
From: brucemdawson at my-deja.com [mailto:brucemdawson at my-deja.com]
Sent: Wednesday, November 01, 2000 8:23 PM
To: python-list at python.org
Subject: Re: a simple example of Stackless Python
...
Okay, that helps. Now, my 'plan' for continuations is I want to
create lightweight threads. I want to be able to start a
function as a thread. Based on your explanation, I think this
would work:
...
My intent was to make the behaviour look a bit like
fork() in unix.

Okay, the big flaw in my code is that no thread is
actually created - all I've done is used a peculiar
syntax to call do_thread_func() - but I'm just
starting. Am I making tiny amounts of sense?
...




More information about the Python-list mailing list