Hi,
> printf under pth is not thread safe and it's behaviour is
> uncertain. I
> tried adding a mutex lock around your I/O and it
> interleaves the writes
> with no problem. See attached program. I ran this under
> Solaris but I
> cannot believe it is any different on other platforms.
well believe it or not, but the program you sent compiled
with native threads works like a charm.
BUT compiled with pth as pthread library does NOT work :(
i did the tests on both redhat linux and openbsd 3.1 just
as i wrote in previous email. just take a look at this:
bash-2.05a$ gcc -o prog prog2.c -pthread
bash-2.05a$ ./prog
o.o.o.
bash-2.05a$ gcc -o prog prog2.c -lpthread -I/tmp/include -L/tmp/lib
bash-2.05a$ ldd prog
libpthread.so.14 => /tmp/lib/libpthread.so.14 (0x40013000)
libc.so.6 => /lib/libc.so.6 (0x40037000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
bash-2.05a$ ./prog
ooo
so what the heck is wrong? :)
terry
______________________________________________________________________
GNU Portable Threads (Pth) http://www.gnu.org/software/pth/
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager (Majordomo) [EMAIL PROTECTED]