Re: thread group comments

From: Andi Kleen (
Date: Fri Sep 01 2000 - 20:21:24 EST

On Fri, Sep 01, 2000 at 06:15:52PM -0700, Linus Torvalds wrote:
> if (!has_done_this_before) {
> pid_t tid;
> has_done_this_before = 1;
> tid = clone(CLONE_PID);

I'm not sure this will work very well (2.4.0test8-pre1):

int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
        int retval = -ENOMEM;
        struct task_struct *p;

        if (clone_flags & CLONE_PID) {
                /* This is only allowed from the boot up thread */
                if (current->pid)
                        return -EPERM;

So it would require fixing CLONE_PID first, which is probably nasty.

Without it it'll still require the context switches when you're calling
pthread_create from the "original" thread.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Thu Sep 07 2000 - 21:00:12 EST