Multithreading and streams

Multithreading and streams

Post by ru.. » Sun, 16 Apr 2000 04:00:00



Hi,

System: Solaris 7, Sun C++ 5.0
I have problem with multithreading and streams.
For example,
   // tper.cpp
   #include <fstream>
   using namespace std;
   int main()
   {
     fstream f;
     return 0;
   }

If
   #CC tper.cpp -o tper
I have not problems.

But if I'll compile with -mt
   #CC tper.cpp -mt -o tper
and try to execute tper, I receive

   signal fault in critical section
   signal number: 11, signal code: 1,
   libthread panic: fault in libthread critical
section (PID:12955 LWP 1)
   ...

This problem disappears if I use static ( static
fstream f; )

Have you any idea or suggestion about this
problem ?

Thanks in advance,
Vitaliy

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Multithreading and streams

Post by Michael Loftu » Tue, 18 Apr 2000 04:00:00


Your sample compiled and executed without error.
(2.6, 5.0)
Make sure you have up-to-date patches for OS & CC.

Michael Loftus (representing only myself)
Ford Motor Co. (my real address has no 'x')


> System: Solaris 7, Sun C++ 5.0
> I have problem with multithreading and streams.
> For example,
>    // tper.cpp
>    #include <fstream>
>    using namespace std;
>    int main()
>    {
>      fstream f;
>      return 0;
>    }