From owner-freebsd-hackers Thu Nov 19 17:10:06 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA20569 for freebsd-hackers-outgoing; Thu, 19 Nov 1998 17:10:06 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA20557 for ; Thu, 19 Nov 1998 17:10:02 -0800 (PST) (envelope-from tlambert@usr09.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.8/8.8.8) id SAA17671; Thu, 19 Nov 1998 18:09:33 -0700 (MST) Received: from usr09.primenet.com(206.165.6.209) via SMTP by smtp04.primenet.com, id smtpd017589; Thu Nov 19 18:09:24 1998 Received: (from tlambert@localhost) by usr09.primenet.com (8.8.5/8.8.5) id SAA22661; Thu, 19 Nov 1998 18:09:16 -0700 (MST) From: Terry Lambert Message-Id: <199811200109.SAA22661@usr09.primenet.com> Subject: Re: SYSV Semaphores & mmap problems To: DBECK@ludens.elte.hu (David Beck) Date: Fri, 20 Nov 1998 01:09:16 +0000 (GMT) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: from "David Beck" at Nov 19, 98 12:32:31 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I ran into two problems with FreeBSD: > 1., If I create a program with a few threads and then I block > one thread with a SYSV semaphore, then it blocks all threads. > Any ideas ? Use a mutex instead. SYSV semaphores are not process reentrant (they're semaphores). Neither are pthreads mutexes, but at least you will only block threads wanting the mutex instead of all threads. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message