From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 19 06:15:15 2007 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 98DEB16A40F for ; Fri, 19 Jan 2007 06:15:15 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.freebsd.org (Postfix) with ESMTP id C553E13C44C for ; Fri, 19 Jan 2007 06:15:14 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (spm4j01tvzmu488b@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id l0J5vevY010187; Thu, 18 Jan 2007 21:57:40 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id l0J5vaul010186; Thu, 18 Jan 2007 21:57:37 -0800 (PST) (envelope-from jmg) Date: Thu, 18 Jan 2007 21:57:36 -0800 From: John-Mark Gurney To: Kevin Sanders Message-ID: <20070119055736.GC92003@funkthat.com> Mail-Followup-To: Kevin Sanders , Ivan Voras , Daniel O'Connor , freebsd-hackers@freebsd.org References: <200701191148.14198.doconnor@gsoft.com.au> <375baf50701181740y6434e763q9c5487fef81dfa87@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <375baf50701181740y6434e763q9c5487fef81dfa87@mail.gmail.com> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: Ivan Voras , freebsd-hackers@freebsd.org Subject: Re: "Streaming" data from kernel to userland X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jan 2007 06:15:15 -0000 Kevin Sanders wrote this message on Thu, Jan 18, 2007 at 17:40 -0800: > On 1/18/07, Daniel O'Connor wrote: > > > >On Friday 19 January 2007 08:52, Ivan Voras wrote: > >> I'm thinking of doing something which would require streaming large > >> amounts of pretty much real-time data from kernel to a userland > >> application (for further processing). The first thing that comes to my > >> mind while thinking of this is sockets, so is there a sockets-like > >> interface which could be used to transfer large amounts of constantly > >> generated data from kernel to a userland application? Any advice on its > >> usage and/or examples? > > > >What's wrong with read()? > > > Ivan, I'm basically doing something similar, and I have found that adding > kqueue support to your kernel module and making ioctl/read/write's is very > efficient. I'm a long time windows developer that has used I/O Completion > Ports, and I'm real impressed with kqueue api. It was a little daunting > figuring out the kernel module side though. If you feeling like extending kqueue(9) to be more helpful, I'm more than willing to review and commit patches for it. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."