Simon Peyton-Jones wrote:
> Now newMVar needs to consult a global variable to get the
> next Flag number, but after that there's no global locking.
I really don't like this at all.  Suppose we have Concurrent Haskell
running on 5000 processors, then every time I want to set this sort of
thing up I have to go and get a new number from some central dispatch
centre, which is ridiculous.  If no-one can solve my problem without
unsafePerformIO and global variables I wonder if there isn't a serious
theoretical hole in Concurrent Haskell.  In this case it could be filled
by having a supply of guaranteed distinct elements from a linear order,
which doesn't have to require a central dispatch centre.  (For example,
you could allocate them on each processor and append a processor id.)

Reply via email to