From owner-freebsd-threads@FreeBSD.ORG Tue Jan 11 00:07:35 2005 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 ED8EB16A4CF for ; Tue, 11 Jan 2005 00:07:34 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D497943D45; Tue, 11 Jan 2005 00:07:34 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from [127.0.0.1] (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id j0B07WoM096217; Tue, 11 Jan 2005 00:07:34 GMT (envelope-from davidxu@freebsd.org) Message-ID: <41E318C2.3040304@freebsd.org> Date: Tue, 11 Jan 2005 08:07:30 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.5) Gecko/20041226 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Petri Helenius References: <41DCEA91.6040402@he.iki.fi> <41DCFD2F.2040207@freebsd.org> <41DD01CE.70004@he.iki.fi> <41DFED9A.8070202@freebsd.org> <41E0256A.1000801@he.iki.fi> In-Reply-To: <41E0256A.1000801@he.iki.fi> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: higher speed mutexes 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: Tue, 11 Jan 2005 00:07:35 -0000 Petri Helenius wrote: > > What happens if the process holding the lock dies? > >> In detail, I don't use thr_suspend and thr_wakeup, I use more >> reliable way: >> umtx_wait + umtx_wake, I have added them into kernel sometimes ago. >> > I was looking at the umtx routines and wondering if I could use them > instead of pthread API. > I will add owner list, when a thread blocked on umtx, an owner list will be created for the umtx, and blocked thread will lookup the owner in system, if there is no the owner, the owner was dead, kernel marks the umtx is in broken state, next locker will find the brokeness, and still gets the lock successfully but with errno is EPIPE, if a thread exits with its owner list not empty, in thr_exit, kernel will mark all umtxes to broken state, and wake up a waiter on each umtx, the waiter should find the brokeness...., it will let do priority proction and priority inherit mutex for POSIX..., I am looking for time to do it.... David Xu