Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
azth
on April 15, 2014
|
parent
|
context
|
favorite
| on:
C/C++ Fiddle
volatile
to the rescue!
vinkelhake
on April 15, 2014
[–]
If by volatile you mean "don't use volatile for this" and "use std::atomic", then I agree completely!
voidlogic
on April 15, 2014
|
parent
[–]
Perhaps azth is writing C?
mpyne
on April 16, 2014
|
root
|
parent
|
next
[–]
C has atomic types now also. And I believe in general that volatile only prevents elision of reads and stores, but not optimization in general. That works for many cases (and I think it would work here) but it doesn't solve data races in general.
comex
on April 16, 2014
|
root
|
parent
|
prev
[–]
C11 has atomics which works similarly to C++11's.
voidlogic
on April 16, 2014
|
root
|
parent
[–]
Sure but the vast majority of C out there is C89/90/99.
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: