Process management (computing): Difference between revisions

Content deleted Content added
AtQor (talk | contribs)
m Process creation: Explanation of Changes | 1. "Another" is replaced with "An alternative" , 2. "to accept an incoming request" is changed to "to accept incoming requests", 3."waking up when a request arrives" is modified to "waking up only when a request arrives"
Snemmik (talk | contribs)
m Some typos and minor language improvements.
Line 7:
In any modern operating system there can be more than one instance of a [[computer program|program]] loaded in memory at the same time. For example, more than one user could be executing the same program, each user having separate copies of the program loaded into memory. With some programs, it is possible to have one copy loaded into memory, while several users have shared access to it so that they can each execute the same program-code. Such a program is said to be [[Reentrant (subroutine)|re-entrant]].{{Relevance inline|date=November 2023}} The [[central processing unit|processor]] at any instant can only be executing one instruction from one program but several processes can be sustained over a period of time by assigning each process to the processor at intervals while the remainder become temporarily inactive. A number of processes being executed over a period of time instead of at the same time is called [[Concurrent computing|concurrent execution]].{{cn|date=November 2023}}
 
A [[multiprogramming]] or [[Computer multitasking|multitasking]] OS is a system executingthat can execute many processes concurrently. Multiprogramming requires that the processor be allocated to each process for a period of time and de-allocated at an appropriate moment. If the processor is de-allocated during the execution of a process, it must be done in such a way that it can be restarted later as easily as possible.
 
There are two possible ways for an OS to regain control of the processor during a program's execution in order for the OS to perform de-allocation or allocation:
Line 27:
where
 
''t''<sub>''i'' (processor)</sub> is the time process ''i'' spends using the CPU, and ''t''<brsub>''i'' (execution)</sub> is the total execution time for the process; i.e. the time for CPU cycles plus I/O cycles to be carried out (executed) until completion of the process.
''t''<sub>''i'' (execution)</sub> is the total execution time for the process; i.e. the time for CPU cycles plus I/O cycles to be carried out (executed) until completion of the process.
 
In fact, usually, the sum of all the processor time, used by ''N'' processes, rarely exceeds a small fraction of the time to execute any one of the processes;
Line 34 ⟶ 33:
: <math>\sum_{j=1}^{N} t_{j \, (\mathrm{processor})} < t_{i \, (\mathrm{execution}\!)}</math>
 
Therefore, in uni-programming systems, the processor laylays idle for a considerable proportion of the time. To overcome this inefficiency, multiprogramming is now implemented in modern operating systems such as [[Linux]], [[UNIX]] and [[Microsoft Windows]]. This enables the processor to switch from one process, X, to another, Y, whenever X is involved in the I/O phase of its execution. Since the processing time is much less than a single job's runtime, the total time to service all ''N'' users with a multiprogramming system can be reduced to approximately:
 
: ''t''<sub>multi</sub> = max(''t''<sub>1</sub>, ''t''<sub>2</sub>, ..., ''t''<sub>''N''</sub>)