Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Dec 1996 18:27:35 CST
From:      Kent Vander Velden <graphix@iastate.edu>
To:        questions@freebsd.org
Subject:   threads and syslog() and read()
Message-ID:  <9612040027.AA30154@spiff.cc.iastate.edu>

next in thread | raw e-mail | index | archive | help

  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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9612040027.AA30154>