开发者

Definition of Multi-threading

开发者 https://www.devze.com 2023-01-27 08:22 出处:网络
Not really programming related this question, but I still hope it fits somehow here :). I wrote the following sentence in my work:

Not really programming related this question, but I still hope it fits somehow here :). I wrote the following sentence in my work:

Mulitthreading refers to the ability of an OS to subdivide an application into
threads, where each of the them are capable to execute independently.

I was told, that this definition of thread is too narrow. I am not really sure why this is the case, coul开发者_开发百科d somebody be so kind to explain me what I missed?

Thank you


Usually, it is the application that decides when to create threads, not the OS. Also, you may want to mention that threads share address space, while each process has its own.


A thread fundamentally, is a saved execution context - a set of saved registers and a stack, that you can resume and continue execution of. This thread can be executed on a processor (these days, many machines of course can execute multiple threads at the same time).

The critical aspect of "multi-threading" is, that an operating system can emulate execution of many threads at the same time, by preempting (stopping) a thread once it has run for a certain amount of time (a "quantum"), then scheduling another thread to run, based on a certain algorithm that is OS-specific.

0

精彩评论

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

关注公众号