[Haskell-cafe] Implementing pi-calculus using STM

Edsko de Vries devriese at cs.tcd.ie
Fri Oct 17 09:56:31 EDT 2008


(Note: assumes knowledge of pi-calculus.)

I am playing with writing a simple interpreter for the pi-calculus  
using STM. The implementation of most of the operators of the pi- 
calculus is straightforward, but I am unsure on how to implement the  
replication operator. The interpretation of !P should be the  
interpretation of the infinite number of parallel processes P | P |  
P ... . I am implementing parallel processes using the fork operation,  
but spawning an infinite amount of processes -- even if the (infinite)  
majority of them all immediately lock -- seems like a bad idea.

So I would prefer to spawn one P, and as soon as the thread that  
interprets P makes any progress at all, spawn another, and so on. I'm  
not too sure however how to achieve this.

Any ideas?


More information about the Haskell-Cafe mailing list