From owner-freebsd-threads@FreeBSD.ORG Wed Jun 25 22:03:25 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B13A37B401 for ; Wed, 25 Jun 2003 22:03:25 -0700 (PDT) Received: from lakemtao07.cox.net (lakemtao07.cox.net [68.1.17.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id B60E643FF5 for ; Wed, 25 Jun 2003 22:03:24 -0700 (PDT) (envelope-from mezz7@cox.net) Received: from mezz.mezzweb.com ([68.103.32.11]) by lakemtao07.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030626050323.GSCP4514.lakemtao07.cox.net@mezz.mezzweb.com>; Thu, 26 Jun 2003 01:03:23 -0400 To: Anurag Chaudhary References: Message-ID: Content-Type: text/plain; charset=utf-8; format=flowed From: Jeremy Messenger MIME-Version: 1.0 Date: Thu, 26 Jun 2003 00:03:29 -0500 In-Reply-To: User-Agent: Opera7.11/Linux M2 build 406 cc: freebsd-threads@freebsd.org Subject: Re: threads and semaphores X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jun 2003 05:03:25 -0000 On Thu, 26 Jun 2003 10:17:02 +0530, Anurag Chaudhary wrote: > hi > > how can I keep my parent thread working and responding to user inputs > while the child thread is waiting for a semaphore using semop() which is > held by some other process. > In linux the parent thread remains active in such situation but in > freebsd the parent thread stops responding until the child thread returns > from semop(). > Is this implementation dependent feature. > Is there something that lets the child thread release resources while > waiting for the semaphore. > I used pthread_yield() but didn't work. > I also tried to change the scheduling policy and priority of the child > thread but of no use. > I am using sys V threads with pthread library on freebsd 5.0 release. You do really need to update your FreeBSD to 5.1 if you want to play with the libkse/libthr (thread).. Cheers, Mezz > Actually I am porting this code from linux to freebsd and facing this > problem > > somebody please suggest some workaround > > thanx > Chaudhary Anurag -- bsdforums.org 's moderator, mezz.