rrnewton / haskell-lockfree

A collection of different packages for CAS based data structures.
106 stars 25 forks source link

Make tickets safe #79

Closed treeowl closed 1 year ago

treeowl commented 4 years ago

Fixes #5

treeowl commented 4 years ago

I document that Tickets should never be forced. The alternative, which I've brought up before, is to define Ticket as a datatype instead of a newtype. In that case, it's important to do the opposite and make sure functions are all strict in tickets so they get unboxed and don't cause delays and thereby CAS failures. Either way, users have to be careful.

treeowl commented 1 year ago

I really don't like Ticket being a newtype. I'm going to close this and see if anyone is interested in the datatype approach.