From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 22 15:33:53 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E99AA1065696 for ; Fri, 22 Jan 2010 15:33:53 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id A51E88FC14 for ; Fri, 22 Jan 2010 15:33:53 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.50) id 1NYLW9-0004xC-EA for freebsd-hackers@freebsd.org; Fri, 22 Jan 2010 16:33:49 +0100 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Jan 2010 16:33:49 +0100 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Jan 2010 16:33:49 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Fri, 22 Jan 2010 16:33:27 +0100 Lines: 31 Message-ID: References: <9bbcef731001220527u5bbec479n59143b6631c6e2d8@mail.gmail.com> <20100122151035.GX77705@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20100118 Thunderbird/3.0 In-Reply-To: <20100122151035.GX77705@hoeg.nl> Sender: news Subject: Re: Greetings... a patch I would like your comments on... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2010 15:33:54 -0000 On 01/22/10 16:10, Ed Schouten wrote: > * Ivan Voras wrote: >> This is a good and useful addition! I think Windows has implemented a >> generalization of this (called "wait objects" or something like that), >> which effectively allows a select()- (or in this case kqueue())-like >> syscall to wait on both file descriptors and condvars (as well as >> probably other MS-style objects). It's useful for multiplexing events >> for dissimilar sources. > > NtWaitForSingleObject(), NtWaitForMultipleObjects(), etc. :-) > Yes, I was thinking about WaitForMultipleObjects() - I sometimes wished I had it in FreeBSD :) I think the hackers@ side of the thread is missing the original link to the patch file offered for review, so here it is: http://people.freebsd.org/~rrs/kque_umtx.patch My kqueue-fu level is too low to be really useful here but from what I've read it looks like a logical and even reasonably clean way of doing it. If I read the comment at filt_umtxattach() correctly, in the best case you would need an extension to the kevent structure to add more fields like data & udata (for passing values back and forth between userland and kernel). I agree with this - it would be very convenient for some future purposes (like file modification notification) if the kernel filter could both accept and return a struct of data from/to the userland.