Re: [PATCH][RFC] kthread abstraction

From: Andi Kleen (ak@suse.de)
Date: Fri Feb 01 2002 - 11:50:33 EST


Christoph Hellwig <hch@caldera.de> writes:

        
> void *data;
>
> Opaque data for the thread's use.

That requires to dynamically allocate and initialize kthread if you
can have potentially multiple threads (= too much to write)

I think it would be better to pass data as a separate argument.
You can put the kthread and the data into a private structure on
the stack, pass the address of it to kernel_thread and wait until the
thread has read it using a completion.

That would make a nicer API.

-Andi
-
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 Feb 07 2002 - 21:00:15 EST