Re: [patch] threading fix, tid-2.5.47-A3

From: Ulrich Drepper (drepper@redhat.com)
Date: Mon Nov 18 2002 - 03:21:26 EST


Luca Barbieri wrote:

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

> There are: suppose that you want to implement the int cfork(int* pid)
> function, which returns the pid in *pid in the parent vm, in a
> multithreaded application.

Correct, for a cfork() implementation two separate pointers would be
needed. Ingo was asking the same question.

Note that I haven't received a request for such a fork interface variant
yet. There obviously is a problem with fork() in MT apps but people are
either not hitting it or working around it. In any case, cfork() would
at least for the time being Linux-specific anyway.

If people are in fact interested in such a new interface then you should
start asking Linus to change his mind on the second parameter. I'm at
this point in time neutral since there is no urgent need from my
perspective to implement cfork(),

> You could avoid the additional pointer by letting
> child_tidptr = (!(flags & CLONE_VM) && current->user_tid) ?
> current->user_tid : parent_tidptr;

This doesn't work since it would overwrite the TID field in the calling
thread's descriptor.

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

iD8DBQE92KMJ2ijCOnn/RHQRAqciAKCCZanzvzkgEND8YdMt9Q79V5DWlwCgikX/
W1RMEu4Vz8KQn0BlIZ7zlFo=
=Hkaz
-----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 : Sat Nov 23 2002 - 22:00:21 EST