Michael Blizek wrote:
On 09:10 Wed 16 Apr , ravikumar wrote:Michael Blizek wrote:On 20:57 Sun 13 Apr , V.Ravikumar wrote:Hello all, Please clarify the following quetions? 1. How many kernel threads will be created for a user space process consists say 5 threads.Zero. Just 5 kernel stacks - one for every user space thread; This stack is used when a user space thread executes a syscall. In the kernel this is software interrupt context. On x86 systems which do not have the syscall instruction the syscall is executed by moving the arguments in the register and then executing "int 0x80". Do not mix it with SoftIRQ, this is something completly different.2. What is the differece btw linux kernel process and kernel thread. I read in linux there is no differece btw a kernel process and kernel threadWhat is a kernel process? I thought Linux is a monolithic kernel and executes everything in the same address space... -Michiwhat is the diffrence btw process and kernel thread?Threads belonging to the same process share the address space, namespace and file descriptors. Processes do not. Processes can use e.g. STDIN/STDOUT and System V IPC for communicating. Threads usually use shared datastructures, which need to be *very* carefully synchronized. This is often and done richt and leads to racing conditions and deadlocks. -Michi In the book 'Linux Kernel Development Second Edition By Robert Love' i found the following setence. "Linux has a unique implementation of threads: It does not differentiate between threads and processes. To Linux, a thread is just a special kind of process." Then how these two were implemented , just by setting necessary flags for clone() system call.? And one more question how kernel schedules threads and processes. |