Re: [PATCH] bug in setpgid()? process groups and thread groups

From: Ulrich Drepper (drepper@redhat.com)
Date: Sat Aug 02 2003 - 03:20:05 EST


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeremy Fitzhardinge wrote:

> I think there's a bug in setpgid(). At present, it only allows the
> thread group leader to change process groups, but it doesn't change the
> other threads in the thread group to the new process group.

The PGID is not the only value which is handled incorrectly like this.
The PID, GID, etc all need to be treated similarly.

Your approach with iterating over the threads is not acceptable (at
least to me). It is racy (concurrent runs are not synchronized) and has
a non-constant time. We've sketched out already a mechanism which
solves to problem. Basically, most of the time the value from the
thread group leader is used (just follow the pointer). Then setting the
value is an atomic operation an constant.

The problem is that Linus already said it is too late for this for 2.6.
 So we are waiting for a signal that the time is right. The changes
will be substantial since all the different IDs should be covered.

- --
- --------------. ,-. 444 Castro Street
Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA
Red Hat `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/K3Q12ijCOnn/RHQRAonMAJ9L5s/ZH682oq3/gT6OfNcC+V+QTACdFESs
bwhXkcCynmDdtszLiE5OZn8=
=fyzs
-----END PGP SIGNATURE-----

-
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/



This archive was generated by hypermail 2b29 : Thu Aug 07 2003 - 22:00:18 EST