[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lightweight coroutines in C (take 2)



Quoting Tom Locke <tom@xxxxxxxxxxxxx>:
>
> [Summary: this approach to lightweight threads puts a heavy penalty on
> sub-routine calls, and hence is no basis for a CSP kernel]

Tom,
My intent was not suggest that the coroutine idea would provide a real basis for
a CSP kernel in C (we aleady have CCSP anyway). Rather, I wanted to share a
"neat hack" that could perhaps be used to emulate a CSP-like style of
programming - or at least to provide a new way of looking at sequential C. IMHO
it's interesting in the same way that the obfuscated C contest is - an
intriguing way to bend the rules or break the established paradigm, but not
exactly practical or useful in the real world. I apologize if my intent in
posting the original message was unclear.

> [Aside: A real lightweight thread mechanism for Python is available in
> Stackless Python, although Stackless is a somewhat marginal project. The
> PyPy project is building a new VM for Python which will also be
> 'stackless'. PyPy is a rather more serious project, with European
> (academic) funding]

Stackless was looking very interesting for a while, and I recall seeing some
indications that someone had pointed the main developer at Hoare's CSP text.
However, development seems to have slowed recently. Hopefully it will pick up
again soon.

Allan
-- 
Allan McInnes <amcinnes@xxxxxxxxxx>
PhD Candidate
Dept. of Electrical and Computer Engineering
Utah State University