Threads vs Processes [duplicate]
Possible Duplicate:
What are the thread limitations when working on Linux compared to processes for network/IO-bound apps?
What is meant by context switches in threads or processes ? Also which is better : Threads or Processes ? 开发者_如何转开发I mean which is more space efficient and which is more time efficient ?
Take a look at this answer.
I don't think you can say one is better than the other - it depends what you are doing.
There is a detailed overview of context switches here: http://en.wikipedia.org/wiki/Context_switch
In the most basic sense a context switch is when the processor pauses execution of a task to do another task.
Also, you have to remember that threads may be your only choice if your OS is embedded and doesn't support multiple processes ;)
精彩评论