You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Manoj Kasichainula <ma...@raleigh.ibm.com> on 1999/04/13 23:11:06 UTC

Is flockfile() usable?

On Tue, Apr 13, 1999 at 11:43:20AM -0700, Dean Gaudet wrote:
> Which gets us back to the argument about how to do the accepts :) 

Which brings me to a question on dealing with a select-accept model.

flock and it's friends, lock files per-process, meaning that every
thread in a process has the lock as far as its concerned.

I'm reading the O'Reilly pthreads book, and it mentions a set of
functions: flockfile(), ftrylockfile(), and funlockfile(), which are
defined by the pthreads standard (p. 181, table 5-2). These functions
are supposed to allow locking per-thread. Naturally, these would be
much simpler to use than dealing with both an pthread_mutex and an
flock/fcntl.

Does anyone know if these functions are reliably supported on pthreads
platforms? Will they do the job?

Manoj