Re: How to do proper locking

From: Julian Elischer (julian_at_elischer.org)
Date: 08/06/05

  • Next message: Jeremie Le Hen: "Re: Checking sysctl values from within the kernel."
    Date: Fri, 05 Aug 2005 23:59:58 -0700
    To: hselasky@c2i.net
    
    

    Hans Petter Selasky wrote:
    > On Friday 05 August 2005 19:29, John Baldwin wrote:
    >

    >
    > Yes, you are right, but the problem is, that for most callback systems in the
    > kernel, there is no mechanism that will pre-lock some custom mutex before
    > calling the callback.

    Not generally applicable to this case but for example the netgraph callout
    wrappers handlle netgraph node locking so that teh called function can
    assume the node it is working on has been locked.
    It's not applicable because netgraph locking is "different"
    to locking elsewhere in the kernel due to the nature of netgraph.
    But havinng a specific callout wrapper for a subsystem
    does give the ability to do such things.
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Jeremie Le Hen: "Re: Checking sysctl values from within the kernel."

    Relevant Pages

    • Re: NOOB: What is netgraph?
      ... What exactly is netgraph in the kernel? ... > The netgraph system provides a uniform and modular system for the ...
      (comp.unix.bsd.freebsd.misc)
    • Re: in-kernel tcp server
      ... I'm trying to write a little tcp-server kernel module. ... I didn't find a lot of documents about the kernel network programming, ... just one thread which talks about netgraph. ... I started out using netgraph ksockets, but later on it evolved, mainly for performance reasons. ...
      (freebsd-hackers)
    • Re: in-kernel tcp server
      ... On 6/20/07, John Polstra wrote: ... >> I'm trying to write a little tcp-server kernel module. ... >> just one thread which talks about netgraph. ... Nicolas Cormier ...
      (freebsd-hackers)
    • netgraph modules wont unload after use
      ... so I turned to netgraph as the solution.However it seems that netgraph will not permit a module ... This going into the kernel because my bpf based userland stuff is probably not going to hold up to the packet rate. ... ifconfig ath0 ssid ')(allmightytallest' ... But the module will never unload: ...
      (freebsd-net)
    • Some netgraph node global locking patches
      ... I'm starting to work my way through locking for the various netgraph nodes ... shipped with FreeBSD, but have a problem in that I can't easily configure ... The attached patch locks down global variables found in the following node ...
      (freebsd-current)