2005-05-16 13:23:58

by linux

[permalink] [raw]
Subject: 2.6 Kernel Threads

Hi all,
can u tell how i can start/stop a kernel thread in 2.6.x series kernel???


Thanks in advance.


2005-05-16 13:46:00

by Sean Neakums

[permalink] [raw]
Subject: Re: 2.6 Kernel Threads

"linux" <[email protected]> writes:

> can u tell how i can start/stop a kernel thread in 2.6.x series kernel???

If you are talking about creating kernel threads from your own code,
you probably want to have a look at include/linux/kthread.h

--
Dag vijandelijk luchtschip de huismeester is dood

2005-05-16 13:47:41

by Lars Roland

[permalink] [raw]
Subject: Re: 2.6 Kernel Threads

On 5/16/05, linux <[email protected]> wrote:
> Hi all,
> can u tell how i can start/stop a kernel thread in 2.6.x series kernel???

Kernel threads are used to perform crusal operations in the backgorund
and runs solely in kernel-space so I am not fully aware of why you
would want to start and stop them ?.

Anyway you can spawn a new kernel thread using

int kernel_thread(int (*fn)(void *), void * arg, unisgned long flags).



Regards.

Lars Roland

2005-05-16 13:59:04

by linux-os (Dick Johnson)

[permalink] [raw]
Subject: Re: 2.6 Kernel Threads

On Mon, 16 May 2005, linux wrote:

> Hi all,
> can u tell how i can start/stop a kernel thread in 2.6.x series kernel???
>
>
> Thanks in advance.

You send it a signal. There are several drivers that use kernel threads.
You can see how they synchronize shut-down for module removal by
using a semaphone and a signal.


Cheers,
Dick Johnson
Penguin : Linux version 2.6.11 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.