Take the 2-minute tour ×
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It's 100% free, no registration required.

What would be the process state in a multi threaded process, in which threads are in different states (running, waiting, blocked etc)

share|improve this question
3  
Wouldn't it be a mapping from the threads to their individual states? –  Dave Clarke Nov 8 '12 at 11:50

1 Answer 1

In short, the lifecycle of thread does not interfere with the lifecycle of a process.

Processes and threads have different execution cycles; threads will execute and die while their process will continue to run until it gets a exit, truncate or die call due to normal execution (or in case of deadlock handling).

  • If a process contains only one thread, then if the thread is running, the process is in its running state. Otherwise, it can go into ready, wait, or die.
  • If a process contains multiple threads, it will execute until all jobs are completed. If a thread goes inactive it will not end a process; a process may enter ready state or be in running state.
share|improve this answer
    
i may have not explained properly but i hope you get what i want to say.... –  swapyonubuntu Nov 8 '12 at 19:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.