Friday, October 15, 2010

Process, child process and thread in Linux

Threading in Linux is (or was!!!) bit confusing.

Before coming to the main point, we need to have clear idea about process and thread. A process is an instance of a computer program that is being sequentially executed. A single process may contain several executable programs (threads) that work together concurrently to carry out the main function of the process. Threads share global data and address space with other threads running in the same process. On the other hand processes do not share address space. Child process has a own copy of data space (VM) of the parent process. Threads can directly communicate with other threads of its process; processes must use interprocess communication to communicate with child processes. Prior to Linux kernel 2.6, Linux OS was not good for JAVA multithreaded applications.
Introduction of NPTL offers performance improvement in the area of thread creation and destruction. With the new lightweight implementation, creating threads is fast and scalable.
Administrator use LWP id finding thread activity in java application. However, there are specific command in Solaris to get PID and associated lightweight process id.

No comments:

Post a Comment