[lkml]   [2010]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH -mm 0/3] proc: task->signal can't be NULL
    On 03/23, Eric W. Biederman wrote:
    > We need a value that can be computed in constant time, and is not correct
    > except when the number of threads is actively changing.

    Sure. I was thinking of something like

    int get_nr_threads(struct task_struct *tsk)
    int nr = atomic_read(&task->signal->live);
    int reasonable_min = 1;

    if (!thread_group_leader(tsk) && pid_alive(tsk) &&
    reasonable_min = 2;

    return max(nr, reasonable_min);

    but as I said this doesn't look nice at all.

    > > OK. Let's keep this counter as "int nr_thread".
    > >
    > > Besides, when I tried to re-implement get_nr_threads() using signal->live
    > > I got the really ugly result ;)
    > Sounds good.

    OK, please see the "final" patch I am going to send...


     \ /
      Last update: 2010-03-24 18:53    [W:0.042 / U:13.720 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site