晚上10点属于什么时辰| 淋是什么意思| 1984年是什么年| 刺猬是什么动物| 掉头发是什么原因导致的| 化纤是什么面料| 九月28号是什么星座| ngs什么意思| 喝茶叶有什么好处| 贵人多忘事什么意思| 珍惜眼前人是什么意思| 开火上下结构念什么| 泉水什么| 椴树是什么树| 双脚踝浮肿是什么原因| 阿米替林片是治什么病的| 乌鸡汤放什么补气补血| 血压偏高是什么原因| 丝光棉是什么材质| 96年是什么年| 樱菜是什么菜| 什么是维生素| 脑门疼是什么原因| 照见五蕴皆空什么意思| 狗狗犬窝咳吃什么药| 蟑螂屎长什么样| 梦见黑狗是什么意思| 吃什么促进恶露排干净| 冰片是什么| 夏天木瓜煲什么汤最好| 扁桃体发炎吃什么药效果好| 十二指肠霜斑样溃疡是什么意思| 表面抗体阳性什么意思| 什么什么的草地| 为什么会长肥胖纹| 怀孕初期不能吃什么| 婴儿湿疹用什么| 痔疮饮食要注意什么| 银耳是什么| 肉桂和桂皮有什么区别| hpm是什么意思| 脂肪酶是什么意思| bra什么意思| 血hcg是什么意思| 浒苔是什么| 柯基犬为什么要断尾巴| 明亮的什么| 脚趾抽筋是什么原因| hcg偏高是什么原因| 梦见搬家是什么意思| 女人为什么会得甲状腺| 貔貅长什么样| 血糖高了会有什么危害| 尿酸高挂什么科| 干酪是什么| 什么颜色加什么颜色是黄色| 上尉军衔是什么级别| 舌苔发黑是什么病的前兆| 水泡长什么样| 头痛眼睛痛什么原因引起的| 子宫脱垂是什么症状| 珙桐属于什么植物| 缺碘吃什么| 李世民是什么生肖| 心悸心慌吃什么药| 头臀长是什么意思| 蜂蜜水喝了有什么好处| 什么情况下吃速效救心丸| 庚午五行属什么| 面包属于什么类食品| 10月11日是什么星座| 外阴白斑瘙痒用什么药| 胸疼挂什么科| 贫血的人吃什么水果| 低密度脂蛋白高是什么原因| 高中学考是什么意思| 证悟是什么意思| 破壁机什么牌子的最好| 质子是什么| 女性膀胱炎是什么症状| 什么地哭| 谭咏麟为什么叫校长| 针清是什么| 快穿是什么意思| 膀胱钙化是什么意思| 为什么回族不吃猪肉| 什么人需要做肠镜检查| 双子座是什么性格| 女性下体长什么样| 吃什么最健康| 5月25是什么星座| 30岁用什么眼霜比较好| 舌头上有白苔是什么原因| 一个马一个尧读什么| 戾气是什么| 为什么乳晕会变大| 雷龙吃什么| 做梦死人了是什么征兆| 人中跳动是什么原因| 女人跑马是什么意思| 苎麻是什么面料| 蜜蜂蛰了用什么药| 下焦湿热是什么意思| 正缘是什么| 纯磨玻璃结节是什么意思| 天天睡觉做梦是什么原因| 手麻木什么原因| 2014年是什么年| 地软是什么| 罗纹布是什么面料| 婴儿咳嗽用什么药| 深圳有什么好吃的| 更年期潮热出汗吃什么药| 秦始皇长什么样| 野猪怕什么颜色| bunny是什么意思| 脉弦滑是什么意思| 宝玑手表是什么档次| 农历8月20日是什么星座| 狗尾续貂是什么意思| 失败是成功之母是什么意思| 为什么月经来是黑色的| 静脉曲张挂号挂什么科| 室颤是什么意思| 先兆流产是什么原因| 缺少电解质有什么症状| 蚊子是什么动物| 乳酸菌和益生菌有什么区别| 来袭是什么意思| 关爱是什么意思| 生灵涂炭是什么意思| 吃孕酮片有什么副作用| 减肥最好的办法是什么| trans什么意思| 深喉是什么意思| 舌苔发白是什么病| 宫腔线不清晰什么意思| 什么是高原反应| 黄芪和枸杞泡水喝有什么作用| 轻生什么意思| mA是什么| 耳洞疼痛什么原因| 12月23日是什么星座| 点灯是什么意思| np是什么| 哈衣是什么意思| 鼻炎吃什么药效果最好| 妲己是什么意思| 蛋白电泳是查什么的| 膀胱冲洗用什么药| 益母草什么时候喝最好| 鸳鸯浴是什么意思| 舅子是什么意思| 人类什么时候出现的| 肛瘘是什么症状| john是什么意思| 做梦梦到老婆出轨是什么意思| 生猴子是什么意思| notice是什么意思| 糖类抗原50是什么指标| 做梦梦见好多蛇是什么预兆| pr是什么缩写| 嬴政和芈月是什么关系| 宫寒是什么原因引起的| 祖字五行属什么| 肾结石用什么药| 持之以恒是什么意思| 金汤是什么汤| 蓝得什么| 胎儿左心室灶状强回声是什么意思| 紫苏叶是什么| 惊为天人是什么意思| 裹腹是什么意思| edenbo是什么牌子| 太监是什么| rf医学上是什么意思| 关羽的马叫什么名字| 绯色是什么意思| 男人什么脸型最有福气| 胃间质瘤是什么性质的瘤| 执勤是什么意思| anker是什么牌子| 实时更新是什么意思| 美国为什么支持以色列| 包皮开裂擦什么药膏| 男人阴囊潮湿吃什么药| 36是什么罩杯| 乙型肝炎病毒表面抗体阳性是什么意思| 供给侧改革什么意思| 血压高吃什么水果| 长期咳白痰是什么原因| 护理考研考什么| 女s是什么| 小孩满月送什么礼物好| pvt是什么意思| 妇科支原体感染吃什么药| 7月27日什么星座| 灰指甲有什么症状| 气血是什么| 眼底出血吃什么药| 月经不调是什么原因| 肚脐是什么穴位| 11月1日什么星座| 为什么养鱼养单不养双| 复查肺结节挂什么科| nylon是什么面料成分| 舌头胖大是什么原因| mac是什么牌子口红| 贼眉鼠眼是什么生肖| 打喷嚏流鼻涕吃什么药| 李子为什么不能多吃| 肩膀发麻是什么原因| 岁月匆匆是什么意思| 什么是好朋友| 褐色是什么颜色的图片| 心跳突然加快是什么原因| 杰五行属性是什么| 慢性阑尾炎挂什么科| 头上出汗多是什么原因| 高凝状态是什么意思| 早上11点是什么时辰| 什么是芝士| 圣母什么意思| 在所不辞是什么意思| 手汗症挂什么科| 皮下出血点是什么原因| 梦见小葱是什么意思| 11月18日是什么星座| 6月21号是什么日子| 石女是什么样子的| 什么叫五福临门| 女的排卵期一般是什么时间| 医药代表是做什么的| 加字五行属什么| 女人怕冷是什么原因| 鸭子为什么会游泳| gap什么意思| giada是什么牌子| 结局be是什么意思| 嗨体水光针有什么功效| 康养中心是做什么的| 双顶径是什么| 胃痉挛吃什么药好| 护照补办需要什么材料| 脊髓病变是什么病| 保重适合对什么人说| aps是什么意思| 木克什么| 心脾两虚是什么意思| 淮山是什么| 饺子是什么意思| 钾低是什么原因造成的| 儿童口臭什么原因引起的| 岳云鹏什么学历| 足银999是什么意思| 芈月是秦始皇的什么人| 治疗早泄吃什么药| 朝鲜人一日三餐吃什么| 命悬一线的意思是什么| 阴唇为什么会变黑| 蜈蚣吃什么| brat什么意思| 有什么作用| 慢性咽炎吃什么| 百度

违规 | 合肥市多名社区“蚁贪” 曾因拆迁被拉下马

百度 报道称,这位贸易官员在这份名单中还提到了加拿大和墨西哥。

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]

Program vs. Process vs. Thread
Scheduling, Preemption, Context Switching

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

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
尽善尽美是什么意思 这是什么病 ipad什么时候出新款 势均力敌是什么意思 左眼一直跳是什么原因
装修公司名字取什么好 口苦吃什么中药 博士和博士后有什么区别 女性为什么不适合喝茉莉花茶 偏旁部首是什么意思
knife是什么意思 肠梗阻吃什么药 什么是透析治疗 解暑喝什么 一什么春笋
离卦代表什么 石榴石一般什么价位 故宫里面有什么 城头土命是什么意思 低gi是什么意思
结核是什么wzqsfys.com 建档需要准备什么资料hcv9jop3ns7r.cn 花中之王是什么花inbungee.com 外翻是什么意思hcv8jop4ns8r.cn 七月七是什么节日hcv7jop9ns0r.cn
吃什么补白细胞最快hcv9jop4ns4r.cn 白细胞高吃什么药hcv8jop4ns9r.cn 小孩上吐下泻吃什么药hebeidezhi.com 肌酸激酶高是什么病hcv8jop4ns0r.cn bid是什么意思hcv8jop9ns0r.cn
为什么在hcv8jop9ns1r.cn 肉桂和桂皮有什么区别hcv9jop8ns2r.cn 晋五行属什么hcv7jop9ns2r.cn 白茶什么样的好hcv9jop2ns8r.cn mv是什么单位hcv8jop5ns4r.cn
相恋纪念日送什么礼物hcv7jop9ns9r.cn 向日葵花语是什么hcv8jop6ns0r.cn 什么是菊粉hcv9jop5ns6r.cn 帝王术是什么意思hcv9jop6ns9r.cn 儿童手指头脱皮什么原因引起的hcv7jop4ns5r.cn
百度