Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

[1] Neither the C nor C++ standards mention threads at all, so I don't think they disallow doing anything with them.

[2] volatile was never strictly about memory ordering, but that's definitely implied. It was really originally for "this variable is really a hardware doodad. make sure you poke it in exactly the manner the code says to." reordering writes to a hardware device can be disastrous. The standard of course, came quite a bit later after the hardware.



[1] I can't for the life of me find where I saw that the standard considers passing local volatile variables to other threads (I suspect it didn't say threads, but rather something else under which threads can be implied).

[2] Implied by the original usage of volatile? It certainly isn't implied now (or at least, people think it is, even though, according to the standard, it really isn't).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: