From owner-freebsd-hackers Fri Nov 20 01:01:00 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA07990 for freebsd-hackers-outgoing; Fri, 20 Nov 1998 01:01:00 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ludens.elte.hu (ludens.elte.hu [157.181.2.1]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id BAA07980 for ; Fri, 20 Nov 1998 01:00:56 -0800 (PST) (envelope-from DBECK@ludens.elte.hu) Received: from ludens.elte.hu by ludens.elte.hu (MX V4.2 VAX) with SMTP; Fri, 20 Nov 1998 10:00:32 +0100 Date: Fri, 20 Nov 1998 10:00:31 +0000 From: David Beck To: Terry Lambert CC: freebsd-hackers@FreeBSD.ORG Subject: Re: SYSV Semaphores & mmap problems In-Reply-To: <199811200109.SAA22661@usr09.primenet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 20 Nov 1998, Terry Lambert wrote: > Date: Fri, 20 NOV 1998 01:09:16 +0000 (GMT) > From: Terry Lambert > To: David Beck > Cc: freebsd-hackers@FreeBSD.ORG > Subject: Re: SYSV Semaphores & mmap problems > > > 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. Yep. The problem is to control access to a shared memory segment between unrelated processes and in the same time the server process actually is a multithreaded process. David. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message