Content deleted Content added
NwekeFavour (talk | contribs) m a typo error, changed :became" to "become" and also added a synonym of de-allocated just for clarity of what information the line was trying to pass. |
|||
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 called [[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. The execution of multiple processes over a period of time, rather than simultaneously, is called concurrent execution.
A [[multiprogramming]] or [[Computer multitasking|multitasking]] OS is a system that can execute many processes concurrently. Multiprogramming requires that the processor be allocated to each process for a period of time and de-allocated or issued 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 17:
==How multiprogramming increases efficiency==
A common trait observed among processes associated with most computer programs is that they alternate between [[CPU]] cycles and [[I/O]] cycles. For the portion of the time required for CPU cycles, the process is being executed; i.e. is occupying the CPU. During the time required for I/O cycles, the process is not using the processor. Instead, it is either waiting to perform Input/Output, or is actually performing Input/Output. An example of this is reading from or writing to a file on disk. Prior to the advent of [[multiprogramming]], [[computers]] operated as single-user systems. Users of such systems quickly
: ''t''<sub>uni</sub> = ''t''<sub>1</sub> + ''t''<sub>2</sub> + ... + ''t''<sub>''N''</sub>.
|