From owner-freebsd-arch Thu Apr 6 22:31: 7 2000 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id 2DB6D37B8BB for ; Thu, 6 Apr 2000 22:31:03 -0700 (PDT) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id HAA16852 for ; Fri, 7 Apr 2000 07:34:37 +0200 (CEST) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id HAA35382 for freebsd-arch@freebsd.org; Fri, 7 Apr 2000 07:31:01 +0200 (CEST) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id DBD1837C208 for ; Thu, 6 Apr 2000 22:30:33 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id WAA94119; Thu, 6 Apr 2000 22:30:31 -0700 (PDT) (envelope-from dillon) Date: Thu, 6 Apr 2000 22:30:31 -0700 (PDT) From: Matthew Dillon Message-Id: <200004070530.WAA94119@apollo.backplane.com> To: Jonathan Lemon Cc: Archie Cobbs , freebsd-arch@freebsd.org Subject: Re: RFC: kqueue API and rough code References: <200004070107.SAA97591@bubba.whistle.com> <200004070220.TAA92896@apollo.backplane.com> <20000406220454.J80578@prism.flugsvamp.com> <200004070340.UAA93335@apollo.backplane.com> <20000407001929.N80578@prism.flugsvamp.com> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG P.S. please excuse me for getting so excitement, I think you know where I'm coming from and my last reply intimated otherwise. I really do think that passing/returning a pointer rather then doing a copyin/copyout is the way to go, and this is from serious experience in this area. I have nearly 15 years of experience doing this sort of thing in real life embedded systems. I am going to put up a URL for a program module from one of my embedded projects to demonstrate the idea in real-life application code. Keep in mind that the source file below is from an embedded application, not a kernel. http://www.backplane.com/FreeBSD4/showoff1.c Please bring this up and search for 'setdispatch'. Now the model this embedded system is using is an asynchronous software interrupt dispatch model, which I think is the best thing since sliced bread but is something that would not be easy to implement in UNIX. What I would like you to look at is the use of a user data structure. Check out the setop3() call just before second the setdispatch() call, then go down to the NetReadInt() procedure itself where the pointer to this structure is passed (by the kernel) to the dispatch function as 'arg'. This is the power of being able to either pass a user data pointer, or being able to supply it inherently by passing a pointer containing other information but extensible as a user structure, which is later returned. If you have time you should look at the code in general... again, remember that I am not advocating kernel-aided dispatch via software interrupts, I am just using it as a demonstration of what our Goals should be. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message