On Thu, Jun 24, 2010 at 02:14:46PM -0700, Roland McGrath wrote:
Understood -- I wasn't saying that each category posed a unique problem,
but rather making sure that I really had enumerated all the possibilities.
The reason for my "destroying the old" and "forming the new" is the
possibility of someone doing proc_task_readdir() when the group leader
does exec(), which causes all to die, and then the new process does
pthread_create(), forming a new thread group. Because proc_task_readdir()
neither holds a lock nor stays in an RCU read-side critical section
for the full /proc scan, the old group might really be destroyed from
the reader's point of view.
That said, I freely admit that I am not very familiar with this code.
Yep! Same proc_task_readdir() situation as before. The group leader
cannot go away because proc_task_readdir() takes a reference.
OK, good to know -- that does make things simpler.
Agreed. One possible difference is that in #1, no one is going to
complain about the reader quitting, while in this case someone might
well be annoyed if the list of threads is incomplete.
Seems reasonable.
Fair enough. Again, my goal was to ensure that I had covered all the
cases as opposed to ensuring that I had described them minimally.
OK, so maybe "it is OK for readers to stop scanning" is a better way
of putting it?
Does Oleg's checking for the group leader still being alive look correct
to you?
Thanx, Paul
--