http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46096
--- Comment #12 from Danilo <zweifel at gmail dot com> 2010-10-20 16:53:53 UTC --- (In reply to comment #11) > Busy waiting is rarely a good idea, so it depends on what are you exactly > waiting for and whether say pthread_barrier_wait, or mutex, or condvar etc. > wouldn't be more appropriate. My objective of using threads is to detach a system in a simulation environment. For this reason, it would be impracticable to use any type of lock for everytime the I/O changes (which will happen all the time), so I guess volatiles are the only way?? I am still reading the sites posted by Jonathan and understanding the difficulties of doing this in modern CPUs, while it is so easy in hardware. Maybe just always compiling without optimizations will do?