www.delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-SWARE-Spam-Status: | No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS |
X-Spam-Check-By: | sourceware.org |
MIME-Version: | 1.0 |
Date: | Thu, 20 Aug 2009 16:54:51 +0200 |
Message-ID: | <a9a39a210908200754iab8d4b2n1ea92c154e5b2c28@mail.gmail.com> |
Subject: | mingw32 runtime library: msvcrt not thread safe. How to use msvcr90? |
From: | =?UTF-8?B?RnLDqWTDqXJpYyBCcm9u?= <frederic DOT bron AT m4x DOT org> |
To: | cygwin <cygwin AT cygwin DOT com> |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Hi folks, I have a big issue with the C runtime library used when with -mno-cygwin option of g++: it looks to be non thread safe in the istream implementation. The simple program below crashes with segmentation fault when compiled in cygwin with option -mno-cygwin while it works perfectly when compiled with MSVC++ 2008. The difference is that the program compiled from cygwin is linked with msvcrt.dll while the one compiled from MSVC is linked with msvcr90.dll and msvcp90.dll. Do you know the difference between the libraries and why mingw32 uses a different one than MSVC? How can I use the same runtime library with gcc/g++ -mno-cygwin? I am using cygwin 1.5 on Windows XP. Fr=C3=A9d=C3=A9ric #include <iostream> #include <sstream> #include <boost/thread.hpp> struct Task { void operator()() { for (size_t k=3D0 ; k<10000 ; ++k) { double x ; std::istringstream is("10.") ; is >> x ; } } } ; int main() { boost::thread_group g_thread ; for (size_t k=3D0 ; k<10 ; ++k) g_thread.create_thread(Task()) ; g_thread.join_all() ; return 0 ; } -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |