开发者

Threads vs Processes [duplicate]

This question already has answers here: Closed 12 years ago.

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 ;)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜