|
From: Jeremy G. <jn...@nt...> - 2003-09-23 06:56:18
|
Hi Luke,
That is very interesting. I am using Windows XP with SP1. Build environment
is MSYS-1.0.9.exe and compiler, etc is from MinGW-3.1.0-1.exe.
I will try it on W2000 today.
Regards,
Jeremy
> -----Original Message-----
> From: min...@li...
> [mailto:min...@li...] On Behalf Of
> Luke Dunstan
> Sent: 23 September 2003 02:18
> To: min...@li...
> Subject: Re: [Mingw-users] Thread safety problem with stringstreams
>
>
>
> It doesn't crash for me on Windows 2000. What OS are you
> using? You are not
> using the Cygwin compiler, are you?
>
> Luke
>
> ----- Original Message -----
> From: "Jeremy Godfrey" <jn...@nt...>
> To: <min...@li...>
> Sent: Tuesday, September 23, 2003 12:55 AM
> Subject: [Mingw-users] Thread safety problem with stringstreams
>
>
> > Hi,
> >
> > The following code is crashing:
> >
> > #include <sstream>
> > #include <windows.h>
> >
> > unsigned long __stdcall threadFunc(void* pThis)
> > {
> > while (1)
> > {
> > std::ostringstream strm;
> > strm << 999;
> > }
> > }
> >
> > int main(int argc, char* argv[])
> > {
> > ::CreateThread(NULL, 0, threadFunc, 0, 0, NULL);
> > ::CreateThread(NULL, 0, threadFunc, 0, 0, NULL);
> >
> > while (1)
> > ::Sleep(1000);
> > }
> >
> > It seems that the numeric output to the stringstream is not
> thread safe.
> > Character output seems to be OK. Does anyone know anything
> about this? I'm
> > compiling with -mthreads -g.
> >
> > Regards
> > Jeremy Godfrey
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.520 / Virus Database: 318 - Release Date: 18/09/2003
|