From owner-freebsd-current Tue Jul 24 16: 3: 9 2001 Delivered-To: freebsd-current@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id CB50D37B407; Tue, 24 Jul 2001 16:03:01 -0700 (PDT) (envelope-from julian@elischer.org) Received: from elischer.org (InterJet.elischer.org [192.168.1.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id LAA19286; Mon, 23 Jul 2001 11:22:37 -0700 (PDT) Message-ID: <3B5C4D4D.FB83DF26@elischer.org> Date: Mon, 23 Jul 2001 09:14:05 -0700 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en, hu MIME-Version: 1.0 To: Jake Burkholder Cc: jhb@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: mutex blocking queues.. References: <200107231127.f6NBRg985918@k7.locore.ca> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit 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 Jake Burkholder wrote: > > > Why does the mutex not link blocked processes though the > > sleep queue linked list entry? Why does it use the run queue entry? > > Because in some cases its necessary for a process to acquire > mutexes while its on the sleep queue. If they used the same > linkage the queues would get corrupted. can this be fixed? > > > In KSEs the sleep queue and run queue enties go into different > > sub structures and ahve different types so this breaks... > > do I need to do something sleazy or can I just link them together using the > > equivalemt of the p_slpq entry? > > It seems to me that whatever gets placed on the run queues > should also be what goes on the mutex queues. it would at first glance, but it is not the case when you think about it.. threads sleep/block, but the process is still on the run queue If you put all threads in the run queue, then when one runs you need to remove all the others from the queue and then add them again if they didn't get run at that quanta.. better to add the 'kse' onto the queue once, and hang all it's runnable threads off it.. > > > > > -- > > +------------------------------------+ ______ _ __ > > | __--_|\ Julian Elischer | \ U \/ / hard at work in > > | / \ julian@elischer.org +------>x USA \ a very strange > > | ( OZ ) \___ ___ | country ! > > +- X_.---._/ presently in San Francisco \_/ \\ > > v > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-current" in the body of the message -- +------------------------------------+ ______ _ __ | __--_|\ Julian Elischer | \ U \/ / hard at work in | / \ julian@elischer.org +------>x USA \ a very strange | ( OZ ) \___ ___ | country ! +- X_.---._/ presently in San Francisco \_/ \\ v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message