Content deleted Content added
Citation bot (talk | contribs) Add: date. | Use this bot. Report bugs. | Suggested by Abductive | Category:Articles needing expert attention from November 2023 | #UCB_Category 9/26 |
Punker1999 (talk | contribs) copyediting, fixed some incorrect descriptions of how process management works, added some citation, deleted non relevant information. Tags: Reverted nowiki added Visual edit |
||
Line 2:
{{OS}}
Process management is the ways in which a modern-day [[operating system]] (OS) maintains program requirements and processes. A process is a thought or a segment of a program
== Early Computing without Process Management ==
In early computing, computer programs would only execute one program at a time. This was difficult as it would not allow for background processes that exist in modern day computing.
== Multi processing ==
[[Multiprocessing]] is a system executing multiple processes concurrently. This is done through the action of process management. With more complex OS, more is expected to be done for its users. The system wants to be able to work on multiple processes at once to be able to act concurrently. This is done by switching the CPU between what processes are happening. 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}}
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 14 ⟶ 15:
# A hardware [[interrupt]] occurs; for example, a key was pressed on the keyboard, or a timer runs out (used in [[preemption (computing)|pre-emptive multitasking]]).
The stopping of one process and starting (or restarting) of another process is called a [[context switch]] or context change. In many modern operating systems, processes can consist of many sub-processes. This introduces the concept of a ''[[thread (computer science)|thread]]''. A thread may be viewed as a ''sub-process''
==How
The goal with multiprocessing is to have processes running at all times. Doing such allows users to utilize the most out of their CPU's capabilities.
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 the 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 became aware that for much of the time that a computer was allocated to a single user, the processor was idle; when the user was entering information or debugging programs for example. [[Computer scientists]] observed that overall performance of the machine could be improved by letting a different process use the processor whenever one process was waiting for input/output. In a ''uni-programming system'', if ''N'' users were to execute programs with individual execution times of ''t''<sub>1</sub>, ''t''<sub>2</sub>, ..., ''t''<sub>''N''</sub>, then the total time, ''t''<sub>uni</sub>, to service the ''N'' processes (consecutively) of all ''N'' users would be:▼
▲A common trait observed among processes associated with most computer programs, is
: ''t''<sub>uni</sub> = ''t''<sub>1</sub> + ''t''<sub>2</sub> + ... + ''t''<sub>''N''</sub>.
Line 51 ⟶ 54:
Process creation in Windows is done through the CreateProcessA() system call. A new process runs in the security context of the calling process, but otherwise runs independently of the calling process. Methods exist to alter the security context in which a new processes runs. New processes are assigned identifiers by which the can be accessed. Functions are provided to synchronize calling threads to newly created processes.<ref>{{Cite web | url=https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa | title=CreateProcessA function (Processthreadsapi.h) - Win32 apps | date=9 February 2023 }}</ref><ref>{{Cite web | url=https://docs.microsoft.com/en-us/windows/win32/procthread/creating-processes | title=Creating Processes - Win32 apps | date=9 February 2023 }}</ref>
Processes have four states they can be in:
* New; a process that is currently being created
* Running; a process where instructions are being executed
* Ready; a process waiting for the processor
* Terminated: a process that has finished it's execution<ref name=":0" />
These names vary across operating systems and communities, but the concepts are the same.
== Process termination ==
|