From owner-freebsd-current Mon May 7 12:42: 4 2001 Delivered-To: freebsd-current@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id 8E08737B423 for ; Mon, 7 May 2001 12:41:55 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.2/8.11.2) with ESMTP id f47JfdG87368; Mon, 7 May 2001 12:41:39 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200105060731.f467V4g13184@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp> Date: Mon, 07 May 2001 12:37:22 -0700 (PDT) From: John Baldwin To: Seigo Tanimura Subject: RE: select(2) converted to use a condition variable, and optimis Cc: current@FreeBSD.org Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 -- 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