Practical 5
Practical 5
2. Give PID of all processes, how you will terminal the processes
running on your terminal.
$ps -A: This command will help to terminal all the processes running
on in any terminal and will show the PID of all processes.
Output:
3. What is the difference between wait and sleep?
Sleep Wait
It is used to hold the It puts thread in waiting
process state and it won’t back
automatically
It doesn’t release the lock It releases the lock while
while waiting waiting
It is used to produce pause It is used for inter-thread
on execution communication
Calls on thread Calls on object
5. List the system calls for process management.
Following are the System calls for process management along with its
Description
▪ fork() To create a new process
▪ exec() To execute a new program in a process
▪ wait() To wait until a created process completes its execution
▪ exit() To exit from a process execution
▪ getpid() To get a process identifier of the current process
▪ getppid() To get parent process identifier
▪ nice() To bias the existing priority of a process
▪ brk() To increase/decrease the data segment size of a process
Exercise:
1. Observe the output of following commands?
a) $ echo$$
Output :-
b) $sleep 10;date
Output :-
Output:
Conclusion:
Hence, I have successfully executed various process commands on my
personal Linux window.