Content deleted Content added
EditorSenpai (talk | contribs) mNo edit summary |
A multiprogramming or multitasking O.S. is a Operating System that can execute many processes concurrently. Added Operating before system for disambiguition. |
||
(11 intermediate revisions by 9 users not shown) | |||
Line 5:
== Multiprogramming ==
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,
A [[multiprogramming]] or [[Computer multitasking|multitasking]]
There are two 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 and 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 become aware that for much of the time that a computer was allocated to a single user
: ''t''<sub>uni</sub> = ''t''<sub>1</sub> + ''t''<sub>2</sub> + ... + ''t''<sub>''N''</sub>.
Line 115:
== The Kernel system concept ==
The critical parts of the [[operating system|OS]] run in [[kernel mode]], while other [[software]] (such as system utilities and application programs) run in [[user mode]]. This serves as the fundamental distinction between the OS and other [[system software]]. The part of the system executing in the kernel mode is called the [[kernel (computer science)|kernel]], or nucleus, of the OS. The kernel is designed as trusted software, meaning it implements protection mechanisms that cannot be covertly modified by untrusted software running in user mode. Extensions to the OS operate in [[user mode]], so the core functionality of the OS does not depend on these extensions for its correct operation.
A key design decision for any OS function is determining whether it should be implemented in the kernel. If implemented in the kernel, it operates in kernel mode, gaining access to other parts of the kernel and being trusted by them. Conversely, if the function executes in [[user mode]], it lacks access to kernel data structures but requires minimal effort to invoke. Although functions implemented in the kernel can be straightforward, the [[trap (computing)|trap mechanism]] and authentication process required during the call can be relatively resource-intensive. While the kernel code itself runs efficiently, the overhead associated with the call can be significant. This is a subtle but important distinction.
== Requesting system services ==
Line 127 ⟶ 130:
In the [[message passing]] approach, the user process constructs a message that describes the desired service. Then it uses a trusted send function to pass the message to a trusted [[operating system|OS]] [[process (computing)|process]]. The send function serves the same purpose as the trap; that is, it carefully checks the message, switches the [[Microprocessor|processor]] to kernel mode, and then delivers the message to a process that implements the target functions. Meanwhile, the user process waits for the result of the service request with a message receive operation. When the OS process completes the operation, it sends a message back to the user process.
The distinction between the two approaches has important consequences regarding the independence of the OS behavior from the application process behavior, and the resulting performance. As a rule of thumb, [[operating system|operating systems]] based on a [[system call]] interface can be made more efficient than those requiring messages to be exchanged between distinct processes. This is the case even though the system call must be implemented with a trap instruction; that is, even though the trap is relatively expensive to perform, it is more efficient than the message-passing approach, where there are generally higher costs associated with the process [[multiplexing]], message formation and message copying. The system call approach has the interesting property that there is not necessarily any OS process. Instead, a process executing in [[user mode]] changes to [[kernel mode]] when it is executing kernel code, and switches back to user mode when it returns from the OS call. If, on the other hand, the OS is designed as a set of separate processes, it is usually easier to design it so that it gets control of the machine in special situations, than if the kernel is simply a collection of functions executed by
== See also ==
Line 142 ⟶ 145:
* Process Management Models, Scheduling, UNIX System V Release 4:
* Modern Operating Systems, Andrew Tanenbaum, Prentice Hall, (2nd Edition, 2001).
* Operating System Concepts, Silberschatz & Galvin & Gagne (
{{Operating System}}
|