On Tue, Nov 10, 2009 at 8:11 PM, Kristian Evensen <kristian.evensen@xxxxxxxxx> wrote: > Hi, > > Creating kernel threads is quite easy. Please have a look at this article, > > http://lwn.net/Articles/65178/ > > Also you can refer this simple code to create a kernel thread. Hope this > helps. > Sorry for poor error handling and coding style. :) > > Thank you very much for a quick and good reply. However, I guess I should > have been more precise in my initial email. I have gotten very simple > threads running, but am having difficulties finding information about more > specific things. For example synchronization, why the kernel has to be > locked when a new thread is initialized and what is the preferred way of > stopping threads. I see some people use signals, while other use the > kthread_stop. > > -Kristian > > I will try to answer your questions, 1) Synchronization : Please refer to "Unreliable Guide To Locking" here, http://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/index.html 2) I dont think you need to lock the kernel when a new thread is initialized with kthread_create(). May be with these new APIs its no longer needed. Please correct me if I am wrong here. 3) kthread_stop() works by sending a signal to the thread. I guess, kernel provides this API just to avoid explicit signal sending. -Vinit -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ