Re: Compiling for single-threaded use (implicit threading support difference in 4.9.1 vs. 4.8.1)

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

 



On Wed, 15 Oct 2014, Jonathan Wakely wrote:

On 14 October 2014 18:29, Johan Alfredsson wrote:
As my application is single-threaded, I don't want to pay the
performance penalty of mutexes etc. Hence, my question is if it is
possible to explicitly request gcc to compile my application in
single-threaded mode.

It should happen automatically, there's no way to request it because
there should be no need.

Well, I would quite like a compilation flag -fI-promise-not-to-use-threads, that would automatically turn atomics into plain variables with regular operations, turn TLS into regular memory, remove locks, etc, and perform all the optimizations this enables. It isn't quite the same as a runtime test that only skips a few mutexes in the library.

--
Marc Glisse




[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