On Wed, Aug 21, 2002 at 10:01:05PM -0700, Seth Arnold wrote: > On Thu, Aug 22, 2002 at 04:44:26AM -0000, Dinesh Gandhewar wrote: > > Where can I find good document on Multithreaded applications in > > kernel for Linux 2.4.2. > > Dinesh, first, 2.4.2 is very old and has many known bugs. Consider > upgrading to a newer kernel. Second, any application that can be > multithreaded is probably best written as a userland program. It is > sounding far too complex for general kernel code. Third, you can create > new threads by doing whatever it is sys_clone() does, so start by There is a function kernel_thread, that calls clone properly from kernel (there is some magic involved there and doing it properly is arch-dependent). > reading the code there. :) Fourth, be sure you understand completely > everything in Documentation/spinlocks.txt. :) Anyway, it's not too clean what you mean by "multithread application in kernel". If it should fork off several threads and do some computations on it's own - then it belongs to userspace. However if it should just provice services to userland (and may call to other userspace app to get it's data), then it however would still be multithread in the sense that the functions will be called in the processes that called them, so you still need to care about proper locking. 2.4.2 is an old kernel, but locking is stable throughout 2.4.x. ------------------------------------------------------------------------------- Jan 'Bulb' Hudec <bulb@ucw.cz> -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/