Mailinglist Archive: opensuse (1532 mails)

< Previous Next >
Re: [opensuse] Re: zlib, OpenSUSE 10.0 and threads.
  • From: Roger Oberholtzer <roger@xxxxxx>
  • Date: Tue, 03 Jul 2007 08:48:02 +0200
  • Message-id: <1183445282.9246.36.camel@xxxxxxxxxxxx>
On Mon, 2007-07-02 at 20:54 -0400, Cristian Rodriguez R. wrote:
> Roger Oberholtzer escribió:
> > Is the zlib package as supplied with openSUSE 10.0 thread-safe? 
> 
> 
> http://www.zlib.net/zlib_faq.html#faq21 --> sames applies here.

I know this one: "all libs zlib uses must be thread-safe." Rather vague.
I have assumed that "ldd libgz.so.1" would tell this. I get:

        linux-gate.so.1 =>  (0xffffe000)
        libc.so.6 => /lib/tls/libc.so.6 (0x4003a000)
        /lib/ld-linux.so.2 (0x80000000)

So, if I add -pthread to my compile options, this should bring in the
thread version of these libs. This I have done and something is still
fishy.

Perhaps I should explain. I have an application that makes a thread for
each network service it is going to read data from. The thread opens and
writes to a file via gzopen/gzwrite/gzclose. The app checks all return
values and there are no complaints. Data arrives from the net as
expected. gzwrite is called to write each bit if data, and never
complains. However, sometimes a file will be 10 bytes in size and never
grow, even though calls to gzwrite are happening as expected. If I just
write to a file with open/write/close, the data is in the file. The
thread that is doing this is a few lines of C code in a simple blocking
read on the network port, writing when the read return a positive number
of bytes have been read.

The problem is 90% consistent. I would be happy if the error is in my
code. But I do not see it. Obviously :)

-- 
Roger Oberholtzer

OPQ Systems / Ramböll RST

Ramböll Sverige AB
Kapellgränd 7
P.O. Box 4205
SE-102 65 Stockholm, Sweden

Tel: Int +46 8-615 60 20
Fax: Int +46 8-31 42 23

-- 
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >