Re:Go channels are bad
by pjmlp on Wednesday March 02, 2016 @12:47PM
(#11211581)
Java and .NET will do it if you make use of InterlockedIncrement APIs.
[ Parent
| on HN ]
Re:Go channels are bad
by chrisseaton on Wednesday March 02, 2016 @01:01PM
(#11211672)
But I think InterlockedIncrement is just 'lock xaddl x 1', so using InterlockedIncrement would be to do it manually.
I'm asking if any compiler can take a statement which uses a high level, general purpose lock and increments a variable inside it using conventional language expressions, and convert it to use 'lock xaddl x 1' (perhaps via InterlockedIncrement or whatever other intrinsics you have) instead.
I only know Java well, not .NET, but I'm pretty sure no Java compiler does it.