Consider three options for completing processes.
The process correctly
completes on its own after completing its task (for interactive processes,
this is often done at the initiative of a user who, for example, used the
appropriate menu item). To do this, the process code must perform a system
call to complete the process. This
call on POSIX systems is
called _ exit (). It can turn the process that caused it.
The process
crashes due to an error. This output can be provided by the
programmer (error when processing a decision that the program cannot
continue) and may be due to the generation of interruption (division by
zero, access to a secure area memory ' memory, etc.).
The
process is completed by another process or system kernel. For
example, before the OS shutdown, the
kernel stops performing all
processes. The process can terminate a process through systems is the many
calls which in POSIX -a system called kill () .
Once the process completes its work memory reserved for its address space
is freed and can be used for other purposes. All flows of this process also
cease to exist. If there are descendants in this process, their work is
preferably not terminated after the work of the ancestor.
The online
processes are usually terminated when the user logs off.
Synchronous And Asynchronous Execution Of
Processes
When the system is a new process for the old process, there are two basic
options:
❖
Continue execution in parallel with the new process - this mode of
operation is called
asynchronous execution
❖
Suspend execution until the new process is complete - this is called
synchronous execution. (In
this case, they use a special system call,
which is POSIX systems, is called wait ()
The choice of a particular model depends on the specific task. For example,
a web server can create descendant processes to handle requests (if the
descendant set is not enough to handle that request).
In this case, the
processing must be asynchronous, as soon as the descendant is created and
the ancestor must be ready to receive the next request. Compiler C, on the
other hand, must wait for the completion of each step before proceeding to
the next stage, in which case they use synchronous processing.