Content deleted Content added
Add: archive-date. | You can use this tool yourself. Report bugs here. | via #UCB_Gadget |
expand |
||
Line 12:
*allow uses of <code>sig_atomic_t</code> variables in signal handlers.
Operations on <code>volatile</code> variables are not [[atomic operation|atomic]], nor do they establish a proper happens-before relationship for threading. This is specified in the relevant standards (C, C++, [[POSIX]], WIN32),<ref name="auto"/> and volatile variables are not threadsafe in the vast majority of current implementations. Thus, the usage of <code>volatile</code> keyword as a portable synchronization mechanism is discouraged by many C/C++ groups.<ref>{{cite web |title=Volatile Keyword In Visual C++|url=http://msdn2.microsoft.com/en-us/library/12a04hfd.aspx|work=Microsoft MSDN}}</ref><ref>{{cite web |title=Linux Kernel Documentation – Why the "volatile" type class should not be used|url= https://www.kernel.org/doc/html/latest/process/volatile-considered-harmful.html|work=kernel.org}}</ref><ref>{{cite web |title=C++ and the Perils of Double-Checked Locking|url=http://www.aristeia.com/Papers/DDJ_Jul_Aug_2004_revised.pdf|work=DDJ|year=2004|author1=Scott Meyers |author2= Andrei Alexandrescu}}</ref>
===Example of memory-mapped I/O in C===
|