Thursday, July 30, 2009

Theard

  • Single-threaded process

- Single threaded process have one path of execution, and multi-threaded programs have two or more paths of execution. Single threaded programs can perform only one task at a time, and have to finish each task in sequence before they can start another. For most programs, one thread of execution is all you need, but sometimes it makes sense to use multiple threads in a program to accomplish multiple simultaneous tasks.

  • Multi-threaded process

Each process can include many threads.

All threads of a process share:

–memory (program code and global data)


–open file/socket descriptors


–signal handlers and signal dispositions


–working environment (current directory, user ID, etc.)

No comments: