Process Creation
In supporting the creation of a new process,
the operating system must
allocate resources both for the process and the operating system itself.
The process (program under execution) will require a portion of the
available
memory to contain its (typically, read-only) instructions and initial data
requirements. As the process executes, it will demand additional memory
for its execution stack and its heap.
The operating system (as dispatcher) will need to maintain some internal
control structures to support the migration of the process between states.
Where do new processes come from?
- an "under-burdened" operating system may take new process requests from a
batch queue,
- a user logging on at a terminal usually creates an interactive control or
encapsulating process (shell or command interpreter),
- an existing process may request a new process, and
- the operating system itself may create a process after an indirect request
for service (to support networking, printing, ...)
Different operating systems support process creation in different ways.
- by requesting that an existing process be duplicated
(using the fork() call in Linux and macOS),
- by instantiating a process's image from a named location, typically the
program's image from a disk file
(using the spawn() call in (old)DEC-VMS
and the CreateProcess() call in Windows).
CITS2002 Systems Programming, Lecture 8, p5, 14th August 2024.
|