[Haskell-cafe] Implementing a MUD server in haskell

Luke Palmer lrpalmer at gmail.com
Sun Dec 16 15:20:53 EST 2007


On Dec 16, 2007 1:45 PM, Jules Bean <jules at jellybean.co.uk> wrote:
> > This needs to stand up to concurrent modification of a shared world
> > structure, but I think I'll set up the concurrency controls after I get
> > my head around this.t
> The simplest way to do this is to bundle all your big shared mutable
> world into a single MVar. What this amounts to is perfect brute force
> serialisation of the actual modification part: i.e. all world
> modifications share a global lock. This is easy to implement and easy to
> reason about.
>
> If that turns out to be too restrictive, then you split up the MVars
> into smaller pieces, but then you have to think a bit harder to convince
> yourself it is safe.

STM! Why use Haskell concurrently and not use STM?  STM is beautiful.

Luke


More information about the Haskell-Cafe mailing list