gcc version 4.2.1 (Debian 4.2.1-3) System: debian-installation from knoppix 5.1.1
When optimizations are turned on (-O, -O1, -O2, -O3), two or more threads don't recognize when the value of a global variable changes. It doesn't matter if it's a global variable or a pointer to a local variable. The change of its value by thread no 1 will not be recognized by thread no 2. -- Summary: gcc optimizations and threads (pthread) Product: gcc Version: 4.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: driver AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: snes2002 at freenet dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36081