[Haskell-cafe] Simulation and GHC Thread Scheduling

Thomas DuBuisson thomas.dubuisson at gmail.com
Fri May 8 19:22:19 EDT 2009

I have a simple Haskell P2P library that I've been playing with in
simulations of 20 to 600 nodes.   To run the simulation there is a
Haskell thread (forkIO) for every node in the system, one that starts
up all the nodes and prints the info (so prints aren't mangled), and
one that acts as the router.

Before its mentioned - I understand the best way forward would be to
refactor the code into IO-less 'algorithm' sections and other sections
that perform the needed IO when I'm not simulating.  I know this would
allow me to declare what order each node runs in and would free me
from the scheduler.  I'd like to do that if its practical... but!

None-the-less, here I am saying that there are many interesting little
simulations that could be done without refactoring and the correctness
isn't altered by the order of operations (not if the nodes behave
properly, the slight variation is actually a good test).  What I would
like to know is are there any plans for GHC to incorporate
user-definable scheduler?  It would be useful in numerous instance
beyond this poor example; I know user scheduling was briefly mentioned
in Li's paper but haven't seen or heard of any interest from others
since then.


More information about the Haskell-Cafe mailing list