From owner-freebsd-smp@FreeBSD.ORG Sat Mar 27 12:33:07 2004 Return-Path: Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 10C8E16A4CE for ; Sat, 27 Mar 2004 12:33:07 -0800 (PST) Received: from tx3.oucs.ox.ac.uk (tx3.oucs.ox.ac.uk [163.1.2.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A34E43D31 for ; Sat, 27 Mar 2004 12:33:06 -0800 (PST) (envelope-from colin.percival@wadham.ox.ac.uk) Received: from scan3.oucs.ox.ac.uk ([163.1.2.166] helo=localhost) by tx3.oucs.ox.ac.uk with esmtp (Exim 4.24) id 1B7KUL-0001LU-O5 for smp@freebsd.org; Sat, 27 Mar 2004 20:33:05 +0000 Received: from rx3.oucs.ox.ac.uk ([163.1.2.165]) by localhost (scan3.oucs.ox.ac.uk [163.1.2.166]) (amavisd-new, port 25) with ESMTP id 05078-02 for ; Sat, 27 Mar 2004 20:33:05 +0000 (GMT) Received: from gateway.wadham.ox.ac.uk ([163.1.161.253]) by rx3.oucs.ox.ac.uk with smtp (Exim 4.24) id 1B7KUK-0001LD-AZ for smp@freebsd.org; Sat, 27 Mar 2004 20:33:04 +0000 Received: (qmail 18025 invoked by uid 1004); 27 Mar 2004 20:33:04 -0000 Received: from colin.percival@wadham.ox.ac.uk by gateway by uid 71 with qmail-scanner-1.20 (clamscan: 0.67. sweep: 2.18/3.79. Clear:RC:1(163.1.161.131):. Processed in 0.05372 secs); 27 Mar 2004 20:33:04 -0000 Received: from dhcp1131.wadham.ox.ac.uk (HELO piii600.wadham.ox.ac.uk) (163.1.161.131) by gateway.wadham.ox.ac.uk with SMTP; 27 Mar 2004 20:33:04 -0000 Message-Id: <6.0.1.1.1.20040327201519.044ba550@imap.sfu.ca> X-Sender: cperciva@imap.sfu.ca (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 6.0.1.1 Date: Sat, 27 Mar 2004 20:33:00 +0000 To: smp@freebsd.org From: Colin Percival Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: locking primatives X-BeenThere: freebsd-smp@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD SMP implementation group List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Mar 2004 20:33:07 -0000 I'm trying to implement a callout_stop_safe() function (same as callout_stop(), except that it would wait for the callout to finish if it is currently in progress) in order to get around a rather nasty panic in the kqueue code. All I need to do is block until the softclock thread reaches a specified point -- this is pretty much the simplest locking problem possible. Is there any introduction to the various locking methods which would give me some indication of which one I should use? Colin Percival