[ghc-steering-committee] Replace atomicModifyMutVar# (#149), recommendation: accept

Simon Marlow marlowsd at gmail.com
Wed Jul 4 09:19:28 UTC 2018


https://github.com/ghc-proposals/ghc-proposals/pull/149

This proposal is essentially an optimisation to the atomicModifyMutVar#
primitive. I won't repeat the details here, but it amounts to moving one of
the thunks produced by atomicModifyMutVar# out of the primop and into the
atomicModifyIORef wrapper. The advantage is that in the case of the strict
version of the wrapper, atomicModifyIORef', this extra thunk is eliminated
entirely, rather than being created by the primop and then immediately
evaluated by the wrapper.

I propose we accept the proposal to add the new primop in section 2.1,
along with the straightforward additions proposed in sections 2.2 and 2.3.
(the old primop will be removed, but can be defined in GHC.Exts  as a
wrapper around the new primop for backwards compat)

However, the additions to the Data.IORef library should be considered by
the libraries committee separately. (there are naming issues to be resolved
in particular).

Cheers
Simon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20180704/3fb0fdfc/attachment.html>


More information about the ghc-steering-committee mailing list