From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 23 12:19:27 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A2AC16A4D4 for ; Thu, 23 Nov 2006 12:19:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id D0DDD43E1A for ; Thu, 23 Nov 2006 12:17:30 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 909B846D7A; Thu, 23 Nov 2006 07:18:03 -0500 (EST) Date: Thu, 23 Nov 2006 12:18:03 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Ivan Voras In-Reply-To: Message-ID: <20061123121513.U50054@fledge.watson.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org Subject: Re: Kqueue write event position? 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: Thu, 23 Nov 2006 12:19:27 -0000 On Wed, 22 Nov 2006, Ivan Voras wrote: >> From the kqueue(2) manual: > > """ > EVFILT_VNODE Takes a file descriptor as the identifier and the events > to watch for in fflags, and returns when one or more of > the requested events occurs on the descriptor. The > events > to monitor are:... > """ > > I'm interested in NOTE_WRITE, but is there a way to find out where has the > write been performed (position and length)? If not, how difficult would it > be to expand the API so this information is included? My concern with this idea is that kqueues are not really intended to provide an event stream, rather, notification of a condition. As writes often come in batches, it's likely that by the time the kevent is received, several writes will have occurred, but only a single event notification will be present. Is the application you have in mind able to benefit from what is effectively "polled" sampling of writes? Does it benefit in the presence of writes from concurrent writers, where things like the position and length may depend on which of two or more writers wrote to the file most or least recently? Robert N M Watson Computer Laboratory University of Cambridge