Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jan 2001 13:22:30 +0100 (CET)
From:      Erik Mattsson <erikmattsson@home.se>
To:        <freebsd-questions@FreeBSD.ORG>
Subject:   Threads, Sockets, SIGPIPE and Freebsd 4.2 problems
Message-ID:  <Pine.LNX.4.30.0101181314090.17493-100000@grumpy.west.se>

next in thread | raw e-mail | index | archive | help
Im having problem using threads and sockets on a freebsd box.

I'm wondering :
 if it is possible to send() and recv() on a socket at the same time in
different threads ?
 if it is possible to get SIGPIPE's even though you executed
signal(SIGPIPE, SIG_IGN) in every thread ?
 if it is possible that a send() call can hang a thread ?

A little background:
 A server listens on sockets (each socket is placed in one thread), the
server replies to the incoming data and send the info over the same
socket.
 But sometimes it also sends data over the sockets in another thread,
and it seems that when this happens the program 'hangs'. ( it happens
every one of 10 times)
 Ive debugged my program and found that one thread hangs on the send()
method. It never finishs and because of that some mutex's are still locked
the whole server hangs.

 But when Im using gdb, I find that the program receives a SIGPIPE even
though Ive told the program to ignore it; signal(SIGPIPE, SIG_IGN).

 Is it  necessary to run this signal() in every thread, or does it suffice
once in the process ? (ive tried both approaches, with no luck)

 Could anyone shed some light on this ?

 Im using pthreads, freebsd4.2 stable, SMP, dual 600 mhz, 512 mb.

Any help is appreciated, since Im not subscribed to this list, could you
please bcc my mail as well ?? (erikmattsson@home.se)
// Erik



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.30.0101181314090.17493-100000>