From owner-freebsd-current Thu May 10 8:39:47 2001 Delivered-To: freebsd-current@freebsd.org Received: from johnson.mail.mindspring.net (johnson.mail.mindspring.net [207.69.200.177]) by hub.freebsd.org (Postfix) with ESMTP id 9523437B422; Thu, 10 May 2001 08:39:39 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from mindspring.com (pool0519.cvx7-bradley.dialup.earthlink.net [209.178.166.9]) by johnson.mail.mindspring.net (8.9.3/8.8.5) with ESMTP id LAA21010; Thu, 10 May 2001 11:39:32 -0400 (EDT) Message-ID: <3AFAB649.67D53F11@mindspring.com> Date: Thu, 10 May 2001 08:39:53 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Seigo Tanimura Cc: John Baldwin , current@FreeBSD.ORG Subject: Re: select(2) converted to use a condition variable, and optimis References: <200105091020.f49AK7P05497@rina.r.dl.itc.u-tokyo.ac.jp> <200105100006.f4A06Gj35470@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Seigo Tanimura wrote: > A quick and hopefully efficient solution to those problems is to > fhold() struct file's first, then enter polling loop. That seems much > cheaper than to work on free()ing a vnode or a socket with holding a > process lock, provided that struct filedesc and file are protected > properly (and we have to do it anyway). Let me once again point out that fhold(), like crhold(), should act as an l-valued function that takes an r-value as an "argument", as in: a = crhold(b); q = fhold(r); etc. (for all such functions). The reason is that you can not replace it with an instrumented function, otherwise, which would permit you to catch subtle errors that: a = b; crhold(a); q = r; fhold(r); etc. may cause (yes, I know I have held the r-calue in one case and the l-value in the other in the above example; the kernel itself does this all over the place, and I think it's an error). I also think that they should use common base macros: it is exceedingly dangerous to have multiple hold semantics in the kernel. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message