Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 May 2001 15:14:00 +0900
From:      Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
To:        jhb@FreeBSD.org
Cc:        tanimura@r.dl.itc.u-tokyo.ac.jp, current@FreeBSD.org
Subject:   atomic operation of flags (was: RE: select(2) converted to use a condition variable, and optimis)
Message-ID:  <200105150614.f4F6E0P53295@rina.r.dl.itc.u-tokyo.ac.jp>
In-Reply-To: In your message of "Mon, 07 May 2001 12:37:22 -0700 (PDT)" <XFMail.010507123722.jhb@FreeBSD.org>
References:  <200105060731.f467V4g13184@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp> <XFMail.010507123722.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 07 May 2001 12:37:22 -0700 (PDT),
  John Baldwin <jhb@FreeBSD.org> said:

John> You need the lock when clearing the bit in p_flag.  That is why the proc locks
John> are there, so all those proc locks need to stay.  When you clear a bit, you are
John> writing all the bits, so you need to ensure that you can atomically
John> read/modify/write all the bits in p_flag, hence the need for the proc lock.

As we now have a set of atomic operation functions in
machine/atomic.h, why do we not use them to read, modify and write
p_flag atomically? Is that more expensive than protecting by PROC_LOCK
and PROC_UNLOCK?

-- 
Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp> <tanimura@FreeBSD.org>

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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