Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Nov 2002 00:01:20 -0500 (EST)
From:      Garrett Wollman <wollman@lcs.mit.edu>
To:        "Brian Smith" <dbsoft@technologist.com>
Cc:        "current@freebsd.org" <current@FreeBSD.ORG>
Subject:   Re: Are SysV semaphores thread-safe on CURRENT?
Message-ID:  <200211190501.gAJ51KFZ019862@khavrinen.lcs.mit.edu>
In-Reply-To: <20021119043130.WWGB397.mail1-0.chcgil.ameritech.net@bbs>
References:  <Pine.GSO.4.10.10211182130110.12758-100000@pcnet1.pcnet.com> <20021119043130.WWGB397.mail1-0.chcgil.ameritech.net@bbs>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Mon, 18 Nov 2002 22:31:28 -0600, "Brian Smith" <dbsoft@technologist.com> said:

> Is this the recommended method of preventing these problems?

The recommended method of preventing these problems generally is to
use POSIX semaphores (or other POSIX synchronization mechanisms
appropriate to threaded programs.  However, the code to implement
process-shared POSIX semaphores is still experimental.

The problem with System V semaphores is that there is no way to poll
their status while still polling the process's file descriptors.  This
could be fixed by introducing a new kqueue filter, but the semantics
of System V semaphores are difficult to emulate.

Depending on the semantics you require, a semaphore may be implemented
using a pipe or fifo, or by using file or record locking.

-GAWollman


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




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