Process management (computing): Difference between revisions

Content deleted Content added
mNo edit summary
m Gramatical Change: Change to capitalisation and plural words
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, More than one user can be executing the same program, with each user having separate copies of the program loaded into memory. With some programs, Itit 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}} At a given instant, 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 known as 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 a way that the process can restart later as efficiently as possible.
Line 127:
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 usersuser processes in kernel mode. Procedure-based operating systems usually include at least a few [[system process]]es (called [[daemon (computer software)|daemons]] in [[UNIX]]) to handle situations whereby the machine is otherwise idle such as [[scheduling (computing)|scheduling]] and handling the network.{{cn|date=November 2023}}
 
== See also ==