[clean-list] Multithreading in Clean

Arjen van Weelden arjenw@cs.kun.nl
Mon, 28 Jun 2004 09:17:41 +0200


Brent A. Fulgham wrote:
> Arjen van Weelden wrote:
> 
>> Hi,
>>
>> Unfortunately, there is not real support for threads in Clean.
>>
> [ ... ]
> 
>> Personally, i've written a thread simulation library, but it only 
>> supports cooperative concurrency, and does not work with Object I/O, 
>> and is probably not what you want.
> 
> 
> It would be wonderful if some kind of concurrency were present in the 
> language.  That's one of the few areas where Clean is a bit backward.  I 
> don't think most of us users care if the language supports full 
> "processor-level" thread support.  Something like Erlang or MzScheme's 
> higher-level threading primitives would be just fine, at least for me.
> 
> Perhaps something like SML's concurrency model could be used as a basis?
> 
> At any rate, I'm a bit curious about your threading implementation.  
> Would it be possible to include it as a library in CVS?
 >
 > Thanks,
 >
 > -Brent
 >

My implementation (currently broken) emulated threads using 
continuations, and used dynamcs to start processes. A working 
implementation can be extracted from:
ftp://ftp.cs.kun.nl/pub/Clean/papers/2003/vWeA2003-Famke.pdf

See also:
http://citeseer.ist.psu.edu/wand80continuationbased.html
http://citeseer.ist.psu.edu/claessen99functional.html

regards,
	Arjen