From owner-freebsd-hackers Fri Jan 21 5:23:31 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from smtppzh.pzh.nl (webshield.pzh.nl [194.178.168.50]) by hub.freebsd.org (Postfix) with SMTP id 9ABCF15172 for ; Fri, 21 Jan 2000 05:23:25 -0800 (PST) (envelope-from MULHUIJZEN@PZH.NL) Received: FROM smtp.pzh.nl BY smtppzh.pzh.nl ; Fri Jan 21 14:22:22 2000 0000 Received: from PZH40-1-Message_Server by smtp.pzh.nl with Novell_GroupWise; Fri, 21 Jan 2000 14:22:27 +0100 Message-Id: X-Mailer: Novell GroupWise 5.5.2 Date: Fri, 21 Jan 2000 14:21:56 +0100 From: "ROGIER MULHUIJZEN" To: , Cc: , Subject: Re: Using spinning time efficiently? Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >I'm the last person who you'd speak to for an authoritative answer to a >FreeBSD question, but I'll try fielding it. Same here =) What I have gathered about spinning on a lock is that it is indeed waiting for a lock, but not sleeping so that the process doesn't get context switches etc. and thus can react instantly when the lock is freed. So yes, you pay for it in CPU util but you gain the advantage of a much faster reaction time. Thus spinning should only be used on locks of which you know could be freed straight away. I'm not sure this is the truth, but if it is, using spinning time for running another process totally defeats the purpose of spinning. You'd be better of using a semaphore and sleeping. Can someone give an authoritative reply to this? =) DocWilco To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message