[636] in Pthreads mailing list archive
Re: Possibly bug in libpthread and C++ ?
daemon@ATHENA.MIT.EDU (Database Owner)
Tue Apr 15 12:37:35 1997
Date: Tue, 15 Apr 1997 09:24:51 -0700 (PDT)
From: Database Owner <database@galileo.starnetc.com>
To: "Alex Fenyo (eowyn)" <fenyo@email.enst.fr>
Cc: monty@analytikerna.se, pthreads@MIT.EDU
In-Reply-To: <d06u3l88te9.fsf@nikopol.enst.fr>
Don't forget that iostreams are buffered, and write is unbuffered.
Also, I believe that proven threads map a "fake" file descriptor to the
"real" one. I'm not sure if that would have any effect on your test
scenario.
David Green-Seed
dgreen@starnetc.com
Starnet International
On 15 Apr 1997, Alex Fenyo (eowyn) wrote:
> Michael Widenius TcX DataKonsulter AB <monty@analytik.analytikerna.se> writes:
> > >>>>> "eowyn" == eowyn <Alex> writes:
> > You can't use iostreams objects and pthreads because there is no wrapper around them.
> > Other things should work with pthreads.
>
> Why should there be a wrapper arround them ? If I lock a mutex every
> time I use an iostream, there can not be any concurrent access and the
> internal state of the iostream instance cannot then be corrupted.
> Moreover, the iostream calls read and write to perform the low level
> access, and read and write are wrapped by libpthread.
>
> This strange behaviour doesn't occur if I use libc_r, another implementation
> of multithreading (available on FreeBSD). And there is no specific wrapper
> coming with libc_r.
>
> This is why I'm not sure it's a question of wrapper.
>
> Thanks,
> Alexandre Fenyo
>