[SunHELP] (no subject)

sunhelp at sunhelp.org sunhelp at sunhelp.org
Thu Jun 7 19:13:54 CDT 2001


Hi, all

I have a problem when using stream in multithread environment.
The code lists below.

//Source file name is streamtest.cpp
#include <strstream>   // or #include<strstream.h>
using namespace std;

int main()
{
    strstream a_stream;
    return 0;
}

compile and link (using workshop5.0, in Solaris8) with following command:
CC -o streantest streamtest.cpp -mt

When I run the program in Solaris8, it blocks in the strstream's
constructor.

Remove the '-mt' option, it runs well.
But, compiling and running it in Solaris 2.6, it works well.

Why?

thanks.





More information about the SunHELP mailing list