I' trying to write a haskell program which is centered around a very
large data structure that must be simultaneously modified by several
threads of execution at different areas of the data structure.  Now, while
I certainly understand the standard purely-functional "state-change" form
where you take the structure and return an entirely new copy, but in this
case it seems to me that to make just a minor change deep in the structure
would require a massive amount of rebuilding, whats worse is that doing
things this way means that only one thread may operate on the structure at
once, since it has to produce a new copy as output which the other threads
depend on.  Clearly far too inefficient to be practical, I think.  

Now, unless I'm missing something really obvious, what it seems like I
need is mutable data structures.  Is there a way to get those in haskell,
perhaps something like the "ref" container in ML?  Or is there some other
super-clever way of maintaining my data structure across threads?

           ------------------ Peter Amstutz --------------------
           -------------- [EMAIL PROTECTED] -------------
           ------- http://www-unix.oit.umass.edu/~tetron -------
           -----------------------------------------------------

Reply via email to