I am using libstdc++ on MAC for developing extensions for firefox. I am getting crashes inside libstdc+ library when I am referring to it across multiple firefox extensions. I was thinking whether libstdc++ for XCode compiler is reentrant or not. If not, is there any version of libstdc++ is available with is reentrant ?
Asked
Active
Viewed 534 times
1 Answers
2
See the HOWTO at http://www.cs.huji.ac.il/~etsman/Docs/gcc-3.4-base/libstdc++/html/17_intro/howto.html , specifically the section entitled "The Standard C++ library and multithreading".

Vicky
- 12,934
- 4
- 46
- 54
-
Reentrant safety & thread safety are related but not quite the same http://en.wikipedia.org/wiki/Reentrant_(subroutine)#Relation_to_thread_safety – Eugen Constantin Dinca Oct 27 '10 at 19:19
-
@Eugen Constantin Dinca: I realise that (although I admit I could have made it clearer in my answer). However, a non-thread-safe function certainly is not going to be re-entrant, and it reads to me as though there may be issues with thread-safety in the libstdc++ implementation, depending on how the app has been built. – Vicky Oct 27 '10 at 19:51
-
Not necessarily, i.e. if for thread safety you uses a non-recursive mutex you have a thread safe function which is not reentrant... (note that I'm not promoting the usage of recursive mutexes) – Eugen Constantin Dinca Oct 27 '10 at 20:29
-
@Eugin Constantin Dinca: Yes, you can have a thread-safe function which is not re-entrant, but you can't have a re-entrant function that is not thread-safe. Thread-safety is one of the requirements for re-entrancy. – Vicky Oct 28 '10 at 09:20
-
"you can't have a re-entrant function that is not thread-safe": only if the data it's called with is not shared/accessible between threads. – Eugen Constantin Dinca Oct 30 '10 at 00:03
-
That link is for a 9 year old copy of the libstdc++ docs, the current version is http://gcc.gnu.org/onlinedocs/libstdc++/manual/using_concurrency.html – Jonathan Wakely Dec 29 '12 at 14:58