From owner-freebsd-questions Tue Dec 3 16:27:43 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id QAA24606 for questions-outgoing; Tue, 3 Dec 1996 16:27:43 -0800 (PST) Received: from spiff.cc.iastate.edu (spiff.cc.iastate.edu [129.186.142.89]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id QAA24600 for ; Tue, 3 Dec 1996 16:27:39 -0800 (PST) Received: by spiff.cc.iastate.edu with sendmail-5.65 id ; Tue, 3 Dec 1996 18:27:35 -0600 Message-Id: <9612040027.AA30154@spiff.cc.iastate.edu> To: questions@freebsd.org Reply-To: graphix@iastate.edu Subject: threads and syslog() and read() Date: Tue, 03 Dec 1996 18:27:35 CST From: Kent Vander Velden Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk for some reason a program that I am working on that uses pthreads is locking up when making a call to syslog() as well as returning from a read() with errno set to EAGAIN. I have gotten around the read problem by encasing the in a while loop and just continue if errno is EAGAIN but this seems to waste a look of time looping. The syslog() problem I got around by creating a stub function that simply returns. Neither of these solutions are wonderful. Is there something that I should be aware of here? I would like to read() to block the calling thread and not the process. The program waits in the main thread in accept(). With a new connection, pthread_create() is called which does some processsing of socket I/O (no disk I/O). Then the file descriptor returned form acceptt() is closed and pthread_exit() is called. Fairly simple structure. I am overlooking something here? Is our libc_r not as thread safe as it would like to be? Thanks. --- Kent Vander Velden graphix@iastate.edu