From owner-freebsd-current Mon Nov 18 18:33:41 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3819F37B401 for ; Mon, 18 Nov 2002 18:33:40 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id A608443EA9 for ; Mon, 18 Nov 2002 18:33:39 -0800 (PST) (envelope-from eischen@pcnet1.pcnet.com) Received: from localhost (eischen@localhost) by mail.pcnet.com (8.12.3/8.12.1) with ESMTP id gAJ2XcUe015776; Mon, 18 Nov 2002 21:33:38 -0500 (EST) Date: Mon, 18 Nov 2002 21:33:38 -0500 (EST) From: Daniel Eischen To: Brian Smith Cc: "current@freebsd.org" Subject: Re: Are SysV semaphores thread-safe on CURRENT? In-Reply-To: <20021119021821.UQPO397.mail1-0.chcgil.ameritech.net@bbs> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 18 Nov 2002, Brian Smith wrote: > I've been porting an application from Linux to FreeBSD using STABLE, and it appears from looking at the > semaphore code that the SysV semaphores are not thread safe on STABLE. I don't have CURRENT source > code to look at currently. Does anyone know if they are thread-safe in CURRENT? [ I assume you mean semop, semctl, not sema_* or sem_* ] Sure SysV semaphores are thread-safe. When a thread blocks on one, the entire process blocks (no threads run). You won't get any safer than that ;-) -- Dan Eischen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message