Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 07 May 2001 12:37:22 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
Cc:        current@FreeBSD.org
Subject:   RE: select(2) converted to use a condition variable, and optimis
Message-ID:  <XFMail.010507123722.jhb@FreeBSD.org>
In-Reply-To: <200105060731.f467V4g13184@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp>

next in thread | previous in thread | raw e-mail | index | archive | help

On 06-May-01 Seigo Tanimura wrote:
> As conversion of select(2) from msleep(9) to a condition variable is
> in the SMPng TODO list, I have done that task.
> 
> Also, we do not have to lock a process in order to evaluate the result
> of {sel,poll}scan() and the remaining time of {select,poll}(2). It
> should be enough to do those pieces of work first, followed by locking
> a process and wait for a condition variable or selwakeup().

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

Please back out the changes to not lock the process around the p_flag change. 
The rest of the patch looks ok, though I'd like to review the updated version
before it is committed.  Thanks.

> Those changes are in the patch at:
> 
> http://people.FreeBSD.org/~tanimura/patches/selectopt.diff

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.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?XFMail.010507123722.jhb>