[GHC] #15364: Replace the atomicModifyMutVar# primop

#15364: Replace the atomicModifyMutVar# primop -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: 8.8.1 Component: Runtime | Version: 8.5 System | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): Phab:D4884 | Wiki Page: -------------------------------------+------------------------------------- This was [https://github.com/ghc-proposals/ghc- proposals/blob/master/proposals/0027-atomicModifyMutVar.rst accepted proposal #27]. Specifically: 1. Replace `atomicModifyMutVar#` with `atomicModifyMutVar2#`. 2. Add `atomicModifyMutVar_#` and `atomicSwapMutVar#`. 3. Add a function imitating `atomicModifyMutVar#` to `GHC.Exts` for backwards compatibility. 4. Use the new primops where appropriate throughout `base`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15364 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15364: Replace the atomicModifyMutVar# primop -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.8.1 Component: Runtime System | Version: 8.5 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4884 Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * cc: fryguybob (added) Comment: I've put up a differential that implements everything except `atomicSwapMutVar#`, and that sets the stage for adding that as well. I could use some help with `atomicSwapMutVar#`, which is the only primop I ''can't'' implement by just removing code from other ones. I think we'll probably need to add C bits to get access to the necessary exchange intrinsic. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15364#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15364: Replace the atomicModifyMutVar# primop
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: 8.8.1
Component: Runtime System | Version: 8.5
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4884
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by David Feuer

#15364: Replace the atomicModifyMutVar# primop -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.8.1 Component: Runtime System | Version: 8.5 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4884 Wiki Page: | -------------------------------------+------------------------------------- Comment (by dfeuer): We now have the first two primops. We'll need to add `atomicSwapMutVar#` in a separate commit. We don't yet support `xchg` in CMM, so we'll have to add it. I noticed, however, that we do have at least some support for it in the LLVM backend, at least (it's a case of read-modify-write). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15364#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15364: Replace the atomicModifyMutVar# primop -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.8.1 Component: Runtime System | Version: 8.5 Resolution: | Keywords: GHCProposal Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4884 Wiki Page: | -------------------------------------+------------------------------------- Changes (by ckoparkar): * keywords: => GHCProposal -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15364#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC