[Haskell-cafe] Multi agent system

Felipe Almeida Lessa felipe.lessa at gmail.com
Sat Apr 2 14:14:36 CEST 2011


On Sat, Apr 2, 2011 at 11:16 AM, Yves Parès <limestrael at gmail.com> wrote:
> Given that haskell threads are lightweight, is it reasonable to lauch a
> thread per agent and then implement fetch and send through Chans?
> It will be simple to implement and to use, but if I have, say, two hundreds
> of really dumb (sorry, reactive ^^) agents, like ants, I will have to launch
> as many threads.

I don't see any problems with this approach if you have only hundreds
of agents, especially because GHC 7 is a lot faster when using many
threads.  However, if you want hundreds of thousands of agents, maybe
this won't work, but I don't really know what kinds of limits GHC has
8-).  That said, it may be difficult to do better than GHC's scheduler
;-).

Cheers! =)

-- 
Felipe.



More information about the Haskell-Cafe mailing list