From owner-freebsd-hackers Thu Oct 10 18:50:31 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 23C3537B404 for ; Thu, 10 Oct 2002 18:50:30 -0700 (PDT) Received: from mail.empirequest.com (www.empirequest.com [216.126.10.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F81543EAA for ; Thu, 10 Oct 2002 18:50:29 -0700 (PDT) (envelope-from spinlock_lists@empirequest.com) Received: (qmail 13460 invoked by uid 89); 11 Oct 2002 01:50:29 -0000 Received: from unknown (HELO twothousand) (spinlock?lists@empirequest.com@192.168.0.2) by www.empirequest.com with SMTP; 11 Oct 2002 01:50:29 -0000 Message-ID: <000d01c270c8$937a2160$0200a8c0@twothousand> From: "Andrei Cojocaru" To: Subject: Question about light-weight mutex (kind of) Date: Thu, 10 Oct 2002 19:50:28 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello, I have a question, please include me in the reply specifically because I'm not subscribed to the mailing list. Thanks I want a thread to spin atomically on a value until it's equal to 1(i.e. it's waiting for an event), how do I do that? I have no idea.. I want this to be fast, not have to use a mutex each time to protect the value I have an idea of how to do it using atomic assembly statements but I don't want to use assmebly, I want to know if FreeBSD has built-in stuff for this. Please help thanks. This is required because I'm building R/W locks for a transaction system I'm working on, and I need a way for a thread waiting on a lock to be notified when a lock is gotten (and without having the thread block [that's why I want it to spin]). Any hints would be appreciated thanks, once again. ---- Andrei Cojocaru spinlock_lists@empirequest.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message