From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 19 02:08:26 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 39A6F16A407 for ; Fri, 19 Jan 2007 02:08:26 +0000 (UTC) (envelope-from newroswell@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by mx1.freebsd.org (Postfix) with ESMTP id C6EEA13C43E for ; Fri, 19 Jan 2007 02:08:25 +0000 (UTC) (envelope-from newroswell@gmail.com) Received: by ug-out-1314.google.com with SMTP id o2so311711uge for ; Thu, 18 Jan 2007 18:08:24 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=Qv6gB+zyqP8I24vG/aPT9EdDwq86y8TW3EtujiDSCIDjtJfA6kpYKoOvon+YXOVwtTx8cAsfWczdkB5Nqj/Z5v+rn7AIwZT82L8lzkYLP8jF0E68FRKAwObcMelAuzxppOb6CaveFB4sP2l6w7kAK1sHedtSFJeSHsFcPEf86JM= Received: by 10.66.255.7 with SMTP id c7mr2302111ugi.1169170837525; Thu, 18 Jan 2007 17:40:37 -0800 (PST) Received: by 10.67.92.10 with HTTP; Thu, 18 Jan 2007 17:40:37 -0800 (PST) Message-ID: <375baf50701181740y6434e763q9c5487fef81dfa87@mail.gmail.com> Date: Thu, 18 Jan 2007 17:40:37 -0800 From: "Kevin Sanders" To: "Ivan Voras" , "Daniel O'Connor" In-Reply-To: <200701191148.14198.doconnor@gsoft.com.au> MIME-Version: 1.0 References: <200701191148.14198.doconnor@gsoft.com.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: 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 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 02:08:26 -0000 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. Kevin