lkml.org 
[lkml]   [2002]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [patch] threading fix, tid-2.5.47-A3

    On Sun, 17 Nov 2002, Linus Torvalds wrote:

    > In fact, SETTID is clearly useful even without threads, and exactly for
    > the case that Ingo apparently broke with his patch: the parent wants to
    > atomically save the TID of the child in the _parents_ address space (so
    > that a immediate SIGCHLD won't be racy with saving off the pid by the
    > parent).

    while it makes sense, the problem in this case is that the 'TID address'
    is the parent's TID address. (ie. might be futex-waited upon by some other
    context, for an exit() event.)

    i think what makes most sense is what Luca suggested, to split up the
    things and use two different TID address: one for race-less setting of the
    TID in the parent's address space, and another for the race-less
    initialization of the TID value in the child's context.

    > There's no reason to make SETTID/CLEARTID be one flag, since they are
    > clearly different things, and NPTL can just always set both bits if that
    > is the behaviour glibc wants (and I agree with that behaviour, of
    > course. I just disagree with not allowing others to do different
    > things).

    ok, agreed. Other libraries might choose to still do SIGCHLD based exit()
    notification - exit notification and initial-TID setting are separate
    things.

    (i'll send a new patch in a few minutes so that we can see the full impact
    on things.)

    Ingo

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:31    [W:0.022 / U:61.092 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site