[lkml]   [2005]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: Notifier chains are unsafe
    Chandra Seetharaman wrote:
    > Andy, comment above rcu_read_lock says, "It is illegal to block while in
    > an RCU read-side critical section."
    > As i mentioned in the other email we are discussing about "task
    > notifier" in lse-tech. We thought of using RCU, but one of the
    > requirements was that the registered function should be able to block,
    > so we are looking for alternatives.

    What are the requirements that preclude a conventional rwlock? If you
    don't have any, then you should go with that.

    The other solutions I've mentioned before.

    Copy on read.

    Various lock-free schemes:
    SMR hazard pointers
    RCU+SMR (probably overkill since you don't need the read side performance)
    reference counting
    proxy reference counting

    The last would probably be the easiest to implement expecially if you used
    a spinlock to safely increment the reference count without the more complicated
    atomic thread-safety. It's also more self contained.

    User land implementations of most of the above can be found at

    The proxy refcounting stuff is in the atomic-ptr-plus package. It's
    in c++ but you should be able to figure it out.

    RCU+SMR is in the fastsmr package.

    Joe Seigh

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-10-27 03:22    [W:0.021 / U:2.480 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site