thread == task || thread != task?

Status
Not open for further replies.

johncsl82

Advanced Member level 4
Joined
Aug 16, 2004
Messages
105
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
925
hi...

I read of couple saying thread == task......... -.-'''

but the reasource in the internet define them defferently...........

Thanks

 

Well, sure. To many folks those are loosly defined terms.
If you are researching a specific RTOS, then search its documentation for their definitions.
 

Well, a short answer to your question is YES, task=thread.
However, the main difference between them is, that the task is a general term, while the thread is a specific one. When we discuss about multitasking, we are understanding that multiple task are running in parallel. What parallel means here depend on the circumstances. In case of one processor the tasks are running in parallel only from the point of view of the human sensing, because in the reality thay are running in time sharing fashion. But nevertheless, whether we have one processor or several ones, we say that multiple task are executed in parallel. From the operating systems point of view you may have processes or threads. In an environement multiple process and threads are executed in parallel (either on one processor or on more then one). But what is the mainn difference between a process and a thread? Well, when a process is started the OS defines an ID, a memory location where the stack content of the procees is saved, the memory through which the IO transfer happens to files or other external recources + the memory location where the data of the process is stored. Each process has its own data storage, so even if you run two process of the same kind, you have two different memory storage. Syncronization and data exchange is difficult (shared memory, pipelining, ...). On the other hand a process can have multiple threads. By default you have a main thread for each process. And you can create and destroy threads during the executing of the process. Each thread has an ID + the memory location for storing the stack content of the thread. Each thread belonging to a process have access to the data memory of the process. Syncronization and data transfer is much easear between threads belonging to the same process. threads can be created and destroyed much fuster than processes. In conlcusion a task is a common name for both process and threads.
So that is the short story of the task, process and thread. I hope that this short description helps you.

Belsugului
 

From the view of a RTOS: thread==task.In the world of RTOS, the different of thread and process is not very clear. so we just use task instead of thread or process
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…