营卫不和吃什么中成药| 夏天梦见下雪是什么意思| 乳房结节挂什么科室| 飞蛾扑火是什么意思| 阳光灿烂是什么意思| 6个月宝宝可以吃什么水果| 地球什么时候毁灭| 挂失补办身份证需要什么| 什么私语| 什么是矫正视力| 座是什么结构| 莲蓬什么季节成熟| 冬虫夏草是什么| 屁股流血是什么原因| 转氨酶高说明什么| 风寒感冒吃什么药效果好| 牙齿抛光是什么意思| 念珠菌是什么| 放屁是热的是什么原因| 女猴配什么属相最好| 阿胶什么季节吃最好| 老人尿失禁吃什么药最好| 保底工资是什么意思| 欢五行属什么| 岁运并临是什么意思| 酸梅汤不适合什么人喝| 10月16日出生的是什么星座| 五心烦热失眠手脚心发热吃什么药| 潜血阴性是什么意思| 老师的老公叫什么| 拿铁咖啡什么意思| 妇科腺肌症是什么病| 汗疱疹是什么| u是什么单位| 吊兰开花有什么兆头| 日柱灾煞是什么意思| 送女生什么礼物比较好| 脚烧热是什么原因| 生地黄是什么| 日本豆腐是什么材料| 施教区是什么意思| 常吃黑芝麻有什么好处和坏处| 老年人手抖是什么原因| 中指和无名指一样长代表什么| puma是什么意思| 一什么柳树| 包茎挂什么科| 鼻子经常出血是什么原因| 定情信物是什么意思| 去医院查怀孕挂什么科| pid是什么意思| 婊子是什么生肖| lodge是什么意思| 一周不排便是什么原因| 硕士研究生是什么意思| 眼睛充血是什么原因造成的| 大学团委书记什么级别| ua是什么牌子| 人打嗝是什么原因| lbl是什么意思| 豆蔻是什么| 便民门诊是做什么的| 喝茶拉肚子是什么原因| 乙醇是什么| 肺部挂什么科| 老婆饼是什么馅| 叫舅舅的是什么关系| 低血钾是什么原因引起的| 下午五点多是什么时辰| 早孕期间吃什么最营养| 肝血不足吃什么药| 痛风发作期吃什么药| lofter是什么意思| 胃疼吃什么药效果好| 抑郁挂什么科| stranger什么意思| 松子是什么树的果实| 女人抖腿代表什么意思| 脚膜炎用什么药最好| 冷血动物是什么意思| 烟嗓是什么意思| 狗狗肠胃炎吃什么药| 后背酸痛是什么原因| 晚上尿多吃什么药| 起眼屎是什么原因| 红蓝是什么意思| 黑暗料理是什么意思| 蒙奇奇是什么动物| 从容的反义词是什么| 欧莱雅适合什么年龄| 夏天用什么带饭不馊| 坐立不安是什么意思| 火旺是什么意思| 银行卡户名是什么意思| 衣服38码相当于什么码| 咽炎要注意什么饮食| 皮蛋吃了有什么好处和坏处| 什么牌子的笔记本电脑好| 长白眉毛是什么征兆| 户口分户需要什么条件| 排卵期过后是什么期| 人活着为了什么| 小狗呕吐吃什么药| 十月一是什么星座| 弥月之喜是什么意思| 补肾吃什么药效果最好| 学生早餐吃什么方便又营养| sport是什么意思| 1月4日是什么星座| 牡丹什么时候开| 血脂高能吃什么水果| 孕妇为什么不能参加婚礼| 什么是脑死亡| 什么动物睡觉不闭眼| 为什么长鸡眼| 口苦吃什么好得快| 器质性是什么意思| 胃痛胃胀吃什么好| 草酸对人体有什么危害| 胃疼喝什么能缓解疼痛| 喉咙有异物感吃什么药| 属虎生什么属相宝宝好| 体现是什么意思| 鱼油是什么| 高压氧是什么| 痛经吃什么药| 六月二十五号是什么星座| 鱼腥草长什么样| 鸟吃什么食物| 鳞状上皮乳头状瘤是什么| 血液透析是什么意思| 阑尾炎有什么症状表现| 梦到下雪是什么意思| 悉如外人的悉是什么意思| 怀孕喝酒会有什么反应| 甲醇对人体有什么伤害| 张家界莓茶有什么功效| 前列腺增生有什么危害| 蜻蜓是什么动物| 高压正常低压低是什么原因| 羧甲基纤维素钠是什么| 枸杞泡水喝有什么作用| 手指关节疼痛是什么原因| 吃什么补肾壮阳最快| 北京有什么好吃的美食| 绝膑而亡是什么意思| 党内的最高处分是什么| 做喉镜能检查出什么病| 冲鸡蛋水喝有什么好处| 什么馅的馄饨好吃| 脾胃湿热吃什么药| b型和ab型生的孩子是什么血型| 丰富的近义词和反义词是什么| 低密度结节是什么意思| 1984年属鼠的是什么命| 感性什么意思| 益生菌什么牌子最好| 什么原因引起耳石症| 外痔疼痛用什么药最好| b型血和b型血生的孩子是什么血型| 黄柏胶囊主要治什么病| 牛鞭是牛的什么部位| 李子什么颜色| 98属什么| 总胆固醇高忌口什么| 阴道里面瘙痒是什么原因| 阴道炎用什么药好| 月经量少吃什么排淤血| 鸡蛋花的花语是什么| 痛经什么原因引起的| 1944年属什么生肖| 痛风打什么针见效最快| 荨麻疹打什么针| 头皮发白是什么原因| b超能检查出什么| cnc是什么牌子| 定海神针是什么意思| 淞字五行属什么| 大力念什么| 今年为什么闰六月| 陈皮不能和什么一起吃| 66年属马的是什么命| 斑斓什么意思| 养阴生津是什么意思| 盗墓笔记它到底是什么| 牙龈炎吃什么药最有效| 忧郁是什么意思| 过剩是什么意思| 男人眉毛短是什么面相| 鸟死在家里是什么征兆| 心脏病是什么原因引起的| 伤口发炎吃什么消炎药| 涧什么字| 阴茎进入阴道什么感觉| 虚不受补是什么意思| 山水有相逢是什么意思| 牛骨头炖什么好吃| 捣碎东西的器皿叫什么| 倚老卖老什么意思| 血氧低会有什么危害| 与五行属什么| 前门大街有什么好玩的| 嗓子痒咳嗽是什么原因| 灰指甲吃什么药| 西洋参什么时候吃效果最好| 十月十二日是什么星座| 特应性皮炎是什么意思| 乳房检查挂什么科| 消化不良大便什么颜色| 芡实不能和什么一起吃| 水母是什么| 化疗后骨髓抑制是什么意思| 胸片可以检查出什么| 寒包火感冒吃什么药| 下午五点是什么时辰| 9月三号是什么日子| 累赘是什么意思| 嗪读什么| sy是什么意思| 脖子粗是什么原因| 什么是肝性脑病| 乳腺癌吃什么好| 内膜薄是什么意思| 体积是什么意思| 贵族是什么意思啊| 深入交流是什么意思| 平躺头晕是什么原因| 尿液特别黄是什么原因引起的| 甲亢是什么引起的| 口腔异味吃什么药| 贵州菜属于什么菜系| 静脉曲张不治疗会有什么后果| 类风湿不能吃什么食物| 老年痴呆症又叫什么| 诺如病毒吃什么食物| 苦瓜干泡水喝有什么功效| 倾倒是什么意思| 做梦抓到很多鱼是什么征兆| 表姐的儿子叫什么| 甲亢是什么| 手腕疼去医院挂什么科| 姜黄粉是什么| 腹主动脉壁钙化是什么意思| 有毒是什么意思| rna是什么意思| 血压高有什么危害| 狗狗能吃什么水果| 孕早期适合吃什么水果| 什么是工作性质| 做梦下大雨是什么兆头| 肋骨外翻挂什么科| 小孩摇头是什么原因| 孕妇什么时候开始补钙| 中国古代四大发明是什么| 看扁桃体挂什么科| 氧化剂是什么| 受凉了吃什么药| edp是什么意思| 黄五行属性是什么| 什么的少年| 冬枣不能和什么一起吃| 占有欲什么意思| 北京为什么叫四九城| 鹭鸶是什么动物| 百度Jump to content

《三国志13PK》PSV版宣传PV 指尖上的三国由你掌控

From Wikipedia, the free encyclopedia
Program vs. Process vs. Thread
Scheduling, Preemption, Context Switching
百度 很多流行的区块链应用到底是天才发明还是庞氏骗局,时间早晚会给出答案。

In computing, a process is the instance of a computer program that is being executed by one or many threads. There are many different process models, some of which are light weight, but almost all processes (even entire virtual machines) are rooted in an operating system (OS) process which comprises the program code, assigned system resources, physical and logical access permissions, and data structures to initiate, control and coordinate execution activity. Depending on the OS, a process may be made up of multiple threads of execution that execute instructions concurrently.[1][2]

While a computer program is a passive collection of instructions typically stored in a file on disk, a process is the execution of those instructions after being loaded from the disk into memory. Several processes may be associated with the same program; for example, opening up several instances of the same program often results in more than one process being executed.

Multitasking is a method to allow multiple processes to share processors (CPUs) and other system resources. Each CPU (core) executes a single process at a time. However, multitasking allows each processor to switch between tasks that are being executed without having to wait for each task to finish (preemption). Depending on the operating system implementation, switches could be performed when tasks initiate and wait for completion of input/output operations, when a task voluntarily yields the CPU, on hardware interrupts, and when the operating system scheduler decides that a process has expired its fair share of CPU time (e.g, by the Completely Fair Scheduler of the Linux kernel).

A common form of multitasking is provided by CPU's time-sharing that is a method for interleaving the execution of users' processes and threads, and even of independent kernel tasks – although the latter feature is feasible only in preemptive kernels such as Linux. Preemption has an important side effect for interactive processes that are given higher priority with respect to CPU bound processes, therefore users are immediately assigned computing resources at the simple pressing of a key or when moving a mouse. Furthermore, applications like video and music reproduction are given some kind of real-time priority, preempting any other lower priority process. In time-sharing systems, context switches are performed rapidly, which makes it seem like multiple processes are being executed simultaneously on the same processor. This seemingly-simultaneous execution of multiple processes is called concurrency.

For security and reliability, most modern operating systems prevent direct communication between independent processes, providing strictly mediated and controlled inter-process communication.

Representation

[edit]
A list of processes as displayed by htop
A process table as displayed by KDE System Guard
A process table as displayed by KDE System Guard

In general, a computer system process consists of (or is said to own) the following resources:

  • An image of the executable machine code associated with a program.
  • Memory (typically some region of virtual memory); which includes the executable code, process-specific data (input and output), a call stack (to keep track of active subroutines and/or other events), and a heap to hold intermediate computation data generated during run time.
  • Operating system descriptors of resources that are allocated to the process, such as file descriptors (Unix terminology) or handles (Windows), and data sources and sinks.
  • Security attributes, such as the process owner and the process' set of permissions (allowable operations).
  • Processor state (context), such as the content of registers and physical memory addressing. The state is typically stored in computer registers when the process is executing, and in memory otherwise.[1]

The operating system holds most of this information about active processes in data structures called process control blocks. Any subset of the resources, typically at least the processor state, may be associated with each of the process' threads in operating systems that support threads or child processes.

The operating system keeps its processes separate and allocates the resources they need, so that they are less likely to interfere with each other and cause system failures (e.g., deadlock or thrashing). The operating system may also provide mechanisms for inter-process communication to enable processes to interact in safe and predictable ways.

Multitasking and process management

[edit]

A multitasking operating system may just switch between processes to give the appearance of many processes executing simultaneously (that is, in parallel), though in fact only one process can be executing at any one time on a single CPU (unless the CPU has multiple cores, then multithreading or other similar technologies can be used).[a]

It is usual to associate a single process with a main program, and child processes with any spin-off, parallel processes, which behave like asynchronous subroutines. A process is said to own resources, of which an image of its program (in memory) is one such resource. However, in multiprocessing systems many processes may run off of, or share, the same reentrant program at the same location in memory, but each process is said to own its own image of the program.

Processes are often called "tasks" in embedded operating systems. The sense of "process" (or task) is "something that takes up time", as opposed to "memory", which is "something that takes up space".[b]

The above description applies to both processes managed by an operating system, and processes as defined by process calculi.

If a process requests something for which it must wait, it will be blocked. When the process is in the blocked state, it is eligible for swapping to disk, but this is transparent in a virtual memory system, where regions of a process's memory may be really on disk and not in main memory at any time. Even portions of active processes/tasks (executing programs) are eligible for swapping to disk, if the portions have not been used recently. Not all parts of an executing program and its data have to be in physical memory for the associated process to be active.

Process states

[edit]
The various process states, displayed in a state diagram, with arrows indicating possible transitions between states

An operating system kernel that allows multitasking needs processes to have certain states. Names for these states are not standardised, but they have similar functionality.[1]

  • First, the process is "created" by being loaded from a secondary storage device (hard disk drive, CD-ROM, etc.) into main memory. After that the process scheduler assigns it the "waiting" state.
  • While the process is "waiting", it waits for the scheduler to do a so-called context switch. The context switch loads the process into the processor and changes the state to "running" while the previously "running" process is stored in a "waiting" state.
  • If a process in the "running" state needs to wait for a resource (wait for user input or file to open, for example), it is assigned the "blocked" state. The process state is changed back to "waiting" when the process no longer needs to wait (in a blocked state).
  • Once the process finishes execution, or is terminated by the operating system, it is no longer needed. The process is removed instantly or is moved to the "terminated" state. When removed, it just waits to be removed from main memory.[1][3]

Inter-process communication

[edit]

When processes need to communicate with each other they must share parts of their address spaces or use other forms of inter-process communication (IPC). For instance in a shell pipeline, the output of the first process needs to pass to the second one, and so on. Another example is a task that has been decomposed into cooperating but partially independent processes which can run simultaneously (i.e., using concurrency, or true parallelism – the latter model is a particular case of concurrent execution and is feasible whenever multiple CPU cores are available for the processes that are ready to run).

It is even possible for two or more processes to be running on different machines that may run different operating system (OS), therefore some mechanisms for communication and synchronization (called communications protocols for distributed computing) are needed (e.g., the Message Passing Interface {MPI}).

History

[edit]

By the early 1960s, computer control software had evolved from monitor control software, for example IBSYS, to executive control software. Over time, computers got faster while computer time was still neither cheap nor fully utilized; such an environment made multiprogramming possible and necessary. Multiprogramming means that several programs run concurrently. At first, more than one program ran on a single processor, as a result of underlying uniprocessor computer architecture, and they shared scarce and limited hardware resources; consequently, the concurrency was of a serial nature. On later systems with multiple processors, multiple programs may run concurrently in parallel.

Programs consist of sequences of instructions for processors. A single processor can run only one instruction at a time: it is impossible to run more programs at the same time. A program might need some resource, such as an input device, which has a large delay, or a program might start some slow operation, such as sending output to a printer. This would lead to processor being "idle" (unused). To keep the processor busy at all times, the execution of such a program is halted and the operating system switches the processor to run another program. To the user, it will appear that the programs run at the same time (hence the term "parallel").

Shortly thereafter, the notion of a "program" was expanded to the notion of an "executing program and its context". The concept of a process was born, which also became necessary with the invention of re-entrant code. Threads came somewhat later. However, with the advent of concepts such as time-sharing, computer networks, and multiple-CPU shared memory computers, the old "multiprogramming" gave way to true multitasking, multiprocessing and, later, multithreading.

See also

[edit]

Notes

[edit]
  1. ^ Some modern CPUs combine two or more independent processors in a multi-core configuration and can execute several processes simultaneously. Another technique called simultaneous multithreading (used in Intel's Hyper-threading technology) can simulate simultaneous execution of multiple processes or threads.
  2. ^ Tasks and processes refer essentially to the same entity. And, although they have somewhat different terminological histories, they have come to be used as synonyms. Today, the term process is generally preferred over task, except when referring to "multitasking", since the alternative term, "multiprocessing", is too easy to confuse with multiprocessor (which is a computer with two or more CPUs).

References

[edit]
  1. ^ a b c d Silberschatz, Abraham; Cagne, Greg; Galvin, Peter Baer (2004). "Chapter 4. Processes". Operating system concepts with Java (Sixth ed.). John Wiley & Sons. ISBN 0-471-48905-0.
  2. ^ Vahalia, Uresh (1996). "Chapter 2. The Process and the Kernel". UNIX Internals: The New Frontiers. Prentice-Hall Inc. ISBN 0-13-101908-2.
  3. ^ Stallings, William (2005). Operating Systems: internals and design principles (5th ed.). Prentice Hall. ISBN 0-13-127837-1. (particularly chapter 3, section 3.2, "process states", including figure 3.9 "process state transition with suspend states")

Further reading

[edit]
[edit]
操逼什么意思 四级军士长是什么级别 来月经喝啤酒有什么影响 为什么手 胃疼喝什么粥
世界上最大的海洋是什么 骨关节炎是什么原因引起的 流清水鼻涕是什么感冒 中风是什么 蒙脱石是什么
斑秃用什么药 什么叫骨质增生 水克什么 大人发烧吃什么退烧药 什么是人乳头瘤病毒
世界上最多的动物是什么 糖尿病患者适合吃什么水果 焦虑失眠吃什么药最好 防晒隔离什么牌子好 武汉都有什么区
情绪是什么意思hcv7jop6ns7r.cn 淤青用什么药cl108k.com 槟榔中间的膏是什么hcv9jop4ns1r.cn 糖类抗原50是什么指标hcv9jop4ns9r.cn smart什么牌子hcv8jop3ns5r.cn
下下签是什么意思hcv9jop3ns9r.cn 肝不好有什么症状有哪些表现hcv8jop0ns9r.cn rov是什么意思hcv8jop5ns9r.cn 冬是什么生肖hcv8jop1ns1r.cn 前列腺炎有什么征兆hcv9jop2ns6r.cn
kyocera是什么牌子hcv9jop1ns0r.cn 为所当为什么意思hcv8jop8ns5r.cn 11月12日什么星座hcv9jop5ns5r.cn 水肺潜水是什么意思520myf.com 中性粒细胞数目偏高是什么意思hcv9jop1ns1r.cn
乙肝三项检查什么hcv8jop5ns4r.cn 为什么会抑郁hcv7jop4ns7r.cn 手指头麻木吃什么药hcv8jop5ns3r.cn 预防医学是干什么的hcv9jop6ns6r.cn 低俗是什么意思hcv7jop6ns3r.cn
百度