From owner-freebsd-current Tue Oct 20 16:19:26 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA15547 for freebsd-current-outgoing; Tue, 20 Oct 1998 16:19:26 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from helios.dnttm.ru (dnttm-gw.rssi.ru [193.232.0.205]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA15542 for ; Tue, 20 Oct 1998 16:19:21 -0700 (PDT) (envelope-from dima@tejblum.dnttm.rssi.ru) Received: (from uucp@localhost) by helios.dnttm.ru (8.9.1/8.9.1/IP-3) with UUCP id DAA32277; Wed, 21 Oct 1998 03:11:34 +0400 Received: from tejblum.dnttm.rssi.ru (localhost [127.0.0.1]) by tejblum.dnttm.rssi.ru (8.9.1/8.9.1) with ESMTP id DAA02588; Wed, 21 Oct 1998 03:12:40 +0400 (MSD) (envelope-from dima@tejblum.dnttm.rssi.ru) Message-Id: <199810202312.DAA02588@tejblum.dnttm.rssi.ru> X-Mailer: exmh version 2.0gamma 1/27/96 To: Daniel Eischen cc: lists@tar.com, tejblum@arc.hq.cti.ru, current@FreeBSD.ORG, info@highwind.com Subject: Re: Another Serious libc_r problem In-reply-to: Your message of "Tue, 20 Oct 1998 11:45:50 EDT." <199810201545.LAA21709@pcnet1.pcnet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 21 Oct 1998 03:12:40 +0400 From: Dmitrij Tejblum Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Daniel Eischen wrote: > > I don't think you want to wrap anything other than the condtion > queue and dequeue with the condition spin locks; they should be > used just to protect changing the condition variable. > > As long as you enqueue the condition variable before you unlock the > mutex, there should be no race conditions. > Well, specs says that mutex unlocking and enqueuing are atomic, so we may put it in the code ;-|. (Note also that mutex_unlock may fail.) Anyway, what if a rescheduling happens just after thread was enqueued for condition variable, and some other thread signaled the condition? Dima To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message