Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

SELECT COLLAGE

COLLEGE OF BUSSINES AND TECHNOLOGY


Advanced programming in unix
Group members
 Yonas bogale sitotaw 4388/12
 Nahom dinberu gemeda 4374/12
 Selamawit teshome 4378/12
 Hayat murad 4359/12
 Kiflu dessalegn 4365/12
 Abdulaiziz mohammed 4342/12
 Zemezem sitotaw 4390/12

Submitted to: mr.kassahun.s


ENVIRONMENTAL VARIOUS PROCESS LIMITS AT EXIT AND VFORK

Environmental process limits refer to the maximum resources that a process can use in the system. These
limits are set by the operating system to prevent a single process from consuming too many resources and
causing other processes to fail.

There are various types of process limits that can be set, including:

 CPU time limit: This limit restricts the amount of CPU time that a process can consume.
 Memory limit: This limit restricts the amount of memory that a process can allocate.
 File size limit: This limit restricts the maximum size of a file that a process can create.
 Open file limit: This limit restricts the number of files that a process can have open
simultaneously.
 Process limit: This limit restricts the maximum number of processes that a user can create.

These limits can vary depending on the operating system and the system configuration. When a process
reaches its environmental limits, it may fail or be terminated by the operating system.

Two system calls in Unix-like operating systems, namely exit() and vfork().

 The exit () system call is used to terminate the calling process, and it is commonly used to return
a value from a program or signal its termination to the parent process.
 On the other hand, vfork() creates a new process by duplicating the calling process, but it does
not fully copy the process address space. Instead, it shares the address space between the parent
and child processes until the child process calls execve() or exit(). This allows for more efficient
creation of new processes with minimal overhead.
 Regarding environmental and process limits, both exit() and vfork() may have limits on the
resources they can use, such as memory or CPU time. These limits may be set by the operating
system or by the user through configuration files or command-line options. It is important to
consider these limits when using these system calls to avoid exceeding them and potentially
causing errors or crashes.

Environmental various processes limits at exit

Environmental processes can have various limits at their exit points, such as:

 When a process reaches its limit, it may exit or terminate. This can happen if the process runs
out of memory or exceeds its CPU time limit. When a process exits due to environmental
limits, it may return an error code indicating the specific limit that was reached.
 In advanced programming, it is important to handle these errors and gracefully exit the
program when necessary. This can involve freeing up resources and closing open files or
network connections before exiting. It is also important to monitor the system's resource
usage and adjust the process limits as needed to prevent issues from arising.
 Overall, understanding and managing environmental limits is an important part of advanced
programming and system administration. By properly managing these limits, developers can
create more efficient and reliable software that works well within the constraints of the
system.
Overall, environmental process limits are put in place to protect the environment and ensure that
industrial activities are conducted in a sustainable and responsible manner.

Environmental various processes limits at vfork

These limits refer to the constraints that are imposed on a process by its environment, such as the
operating system or hardware. These constraints may include limits on the amount of memory or CPU
time that a process can use, as well as limits on the number of open files or network connections. These
limits are put in place to ensure that a process does not consume too many resources and cause problems
for other processes or the system as a whole. System administrators can adjust these limits to balance the
needs of different processes and ensure that the system runs smoothly.

vfork

 Role
Used to create a new process
 Characteristics
 The call sequence and the return value are the same as the fork;
 Vfork a child process that does not completely replicate the address space of the parent
process to the child process, because the child process calls exec (or exit) immediately, so it
needs to access the address space. But before the child process calls exec (or exit), it runs in
the space of the parent process;
 Vfork guarantees that the child process runs first, and the parent process runs when the
child process finishes executing exec (or exit). However, this can cause deadlocks, for
example, a child process that relies on the parent process for further action;

You might also like