| |
| Posted by Crayo List in reply to Adam D. Ruppe | PermalinkReply |
|
Crayo List
Posted in reply to Adam D. Ruppe
| On Tuesday, 11 December 2018 at 01:37:25 UTC, Adam D. Ruppe wrote:
> On Monday, 10 December 2018 at 23:20:22 UTC, Crayo List wrote:
>> Are there atomic equivalents of bt(), btc(), bts(), btr() ... etc from core.bitop?
>
> Those are intrinsics that compile into a single cpu instruction, so they are probably already atomic...
Thanks Adam,
They need to be prefixed with 'lock' (on x86) in order to be atomic.
That's what _interlockedbittestandset() on Windows does.
And what this page says; https://www.felixcloutier.com/x86/LOCK.html
It may be possible to implement using asm { }, but I was wondering if there wasn't something out there already doing it.
|