OS concepts: Thread vs. Task

I am sure many of us have confused these two terms together. I remember preparing my assignment once in OS, found the copy in cupboard which is like 3 semesters old :D....would like to share it with you all.

A thread is a point of control flow in a task. A task
exists to provide resources for the threads it contains. This split is made to provide
for parallelism and resource sharing.
A thread
  • is a point of control flow in a task.
  • has access to all of the elements of the containing task.
  • executes (potentially) in parallel with other threads, even threads within the same task.
  • has minimal state information for low overhead.
A task
  • is a collection of system resources. These resources, with the exception of the address space, are referenced by ports. These resources may be shared with other tasks if rights to the ports are so distributed.
  • provides a large, potentially sparse address space, referenced by virtual address.Portions of this space may be shared through inheritance or external memory management.
  • contains some number of threads.
Note that a task has no life of its own—only threads execute instructions. When it is
said that “task Y does X,” what is really meant is that “a thread contained within
task Y does X.” ;)

Page copy protected against web site content infringement by Copyscape

1 comment:

Anonymous said...

Very interesting, but why would you choose to implement using one technique over the other? That is, if you are designing a new application that you thought might benefit from parallelism, would you implement it using subtasks or threads?