Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-05-2012, 03:23 AM
|
#1
|
|
LQ Newbie
Registered: Dec 2011
Posts: 12
Rep: 
|
Process vs task vs threads
can anyone explain me the exact difference between process task and threads??
thanks in advance!!!
|
|
|
|
|
Click here to see the post LQ members have rated as the most helpful post in this thread.
|
01-05-2012, 12:42 PM
|
#2
|
|
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,258
|
In Linux, there is no such thing as a task, at least by any formal definition that I know of.
A process is the basic model used to separate running programs and their resources from all other such programs and the kernel. A process has memory resources allocated by the kernel, and these are private to the process, and protected from all other processes. A process is given time for execution of code in it's code memory space by the kernel.
Within a process, there is at least one thread of execution. Using threads, there can be multiple threads of execution that all share the same code memory space that is private to the process. The threads execute independently, but execute a common code segment. Also shared between threads within a process is the data memory, meaning that process variables are common to all threads within the process.
--- rod.
|
|
|
2 members found this post helpful.
|
01-05-2012, 10:39 PM
|
#3
|
|
LQ Newbie
Registered: Dec 2011
Posts: 12
Original Poster
Rep: 
|
gr8!!! thank you  
|
|
|
|
01-06-2012, 12:13 AM
|
#4
|
|
Member
Registered: Feb 2009
Posts: 339
Rep:
|
A process and a thread are treated in the same fashion in linux, except for some small variations. Hence some times the generic term task is used to refer to process as well as thread.
You can read chapter on process management in http://www.amazon.com/Linux-Kernel-D.../dp/0672329468 for more information.
|
|
|
|
01-06-2012, 09:38 AM
|
#5
|
|
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,258
|
Quote:
Originally Posted by bsat
A process and a thread are treated in the same fashion in linux, except for some small variations.
|
Respectfully disagree. What are those 'small variations'? The OP asked for the 'exact difference'. I'd say there are far more differences than there are similarities. If they are substantially the same, why would we have both, and not simply one or the other?
--- rod.
|
|
|
|
01-07-2012, 07:25 AM
|
#6
|
|
Member
Registered: Feb 2009
Posts: 339
Rep:
|
@rod What I meant was they are treated in a similar fashion in linux . To Linux, a thread is just a special kind of process.
As far as I have read the data structures that handle a process as well as thread are the same in linux.
In linux the same system call clone() creates a thread as well as a process, but the difference lies the flags passed to this system call.
So the term task is some times used in place of the term process.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:24 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|