Using mutable array after an unsafeFreezeArray, and GC details

Simon Marlow marlowsd at gmail.com
Mon May 12 08:32:30 UTC 2014


On 09/05/2014 19:21, Brandon Simmons wrote:
> A couple of updates: Edward Yang responded here, confirming the sort
> of track I was thinking on:
>
>    http://blog.ezyang.com/2014/05/ghc-and-mutable-arrays-a-dirty-little-secret/
>
> And I can report that:
>    1) cloning a frozen array doesn't provide the benefits of creating a
> new array and freezing
>    2) and anyway, I'm seeing some segfaults when cloning, freezing,
> reading then writing in my library
>
> I'd love to learn if there are any other approaches I might take, e.g.
> maybe with my own CMM primop variants?

I'm not sure exactly what your workload looks like, but if you have 
arrays that tend to be unmodified for long periods of time it's 
sometimes useful to keep them frozen but thaw before mutating.

How large are your arrays? Perhaps the new small array type (in HEAD but 
not 7.8) would help?

Cheers,
Simon


More information about the Glasgow-haskell-users mailing list