RE: program executin times differ between gcc versions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Marco,

> If you have variables that might be modified by multiple threads you should declare them as volatiles in order to prevent compiler optmization and wrong execution.

NOTE:  the "volatile" qualifying keyword by itself does not prevent problems with multiple threads modifying the variable concurrently.

Neither C nor C++ have language support for multiple threads.  (There are "bolt-on" threading libraries, but that's not the same as multiple threads being supported by the language -- "volatile" is orthogonal to resolving issues due to multiple threads.)

Sincerely,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux