Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Apr 2000 22:30:31 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Jonathan Lemon <jlemon@flugsvamp.com>
Cc:        Archie Cobbs <archie@whistle.com>, freebsd-arch@freebsd.org
Subject:   Re: RFC: kqueue API and rough code
Message-ID:  <200004070530.WAA94119@apollo.backplane.com>
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>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
    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




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?200004070530.WAA94119>