5 ms·
Agreed that the basic "store to 8 locations" API would need tweaking to allow locking. Re: adding a counter into the read set, I think the new generalized API
by scivey7 10y ago
Agreed that the basic "store to 8 locations" API would need tweaking to allow locking.
Re: adding a counter into the read set, I think the new generalized API here will support that out of the box: https://github.com/scivey/xact/blob/master/docs/api/generalized_cas.md https://github.com/scivey/xact/blob/master/docs/api/generali...
Thoughts?
- andikleen2 10y agoYes with a read primitive it could be done in theory. It will be just quite awkward to use however as every caller has to do all that: define a lock, pass it always in, make sure the check for "lock is free" is correct etc. Your unit tests don't seem to do it right. It would probably be easier to hide the lock in your library, and enforce all other access to follow the right protocol using some ADTs. But then you just have a simple hardware TM accelerated STM. FWIW the sweet spots for nice to use TM APIs are currently either lock elision, or compiler assisted TM (like __transaction* in gcc), or higher level libraries.
- deleted 10y ago[deleted]
- scivey7 10y agoYour feedback has been very helpful. Do you mind if I ask you for more advice down the line?