Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jan 2000 14:21:56 +0100
From:      "ROGIER MULHUIJZEN" <MULHUIJZEN@PZH.NL>
To:        <mbac@nyct.net>, <tanimura@r.dl.itc.u-tokyo.ac.jp>
Cc:        <hackers@FreeBSD.ORG>, <smp@FreeBSD.ORG>
Subject:   Re: Using spinning time efficiently?
Message-ID:  <s8886ba3.083@smtp.pzh.nl>

next in thread | raw e-mail | index | archive | help
>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-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?s8886ba3.083>