This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is __default_alloc_template thread safe on Solaris?


Loren James Rittle wrote:
I have extensively used libstdc++ on multithreaded apps on linux platform, however STLs seem to have notorious behaviour on Solaris platform. [...] g++ verion on Solaris is 2.95.3 while


IMHO, it is *very* hard to configure and use threads in STL properly
with g++ 2.95.X (and anything before 3.0) on a random port.  Your
report confirms that fact.  Upgrade your Solaris box to (at least) g++
3.2, where the compiler reports "Thread model: posix".

Regards,
Loren



However defining _PTHREADS as a compiler flag seems to solve my problem.
Would you recommend doing so? It's not actually possible to move into a more recent g++ release due to some other constraints. I see four options,
1. Remove threading (this is not actually possible for me)
2. Move STL related stuff to a single thread
3. Define _PTHREADS as a compiler flag
4. Move to a thread safe STL implementation


What would you recommed?

tnx

dhammika



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]