forked from haskell-github-trust/ekg-core
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reimplement
Atomic
with GHC prim ops
This commit attempts to address issue haskell-github-trust#41 of tibbe/ekg-core by replaceing the C code for `Atomic` with GHC prim ops (`fetchAddIntArray`). However, we insist on a 64-bit counter, so if machine does not support 64-bit prim ops, we fall back to using an `IORef` and `atomicModifyIORefCAS`. The performance of the 64-bit prim ops implementation is somewhat slower than the existing C code, perhaps due to the additional conversion between `Int` and `Int64`.
- Loading branch information
Showing
2 changed files
with
83 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters