1. Process can be in different states to allocate the resources better. List the
ID: 3546139 • Letter: 1
Question
1. Process can be in different states to allocate the resources better. List the symbol and meaning for each of these states. (10 points)
2. What does it mean to spawn a process? (10 points)
3. How can you determine what processes are owned by the current login user? (10 points)
4. Compare and contrast a job number with a process identification number.(10 points)
5. For this questions, refer to the following listing: (each 10 points)
[2] Stopped sort /etc/passwd
[3] - Stopped vi .cshrc
[4] + Stopped more .login
[5] Running find / -name foo
(1) What command would you use to bring the vi editor to the foreground?
(2) What is the command you would use to kill the more?
(3) What is the command you would use to get this listing?
6. Compare and contrast background and foreground jobs. Include the syntax you use to place a command in foreground and in background.(10 points)
7. What is the function of jobs command? (10 points)
8. How do you bring a job from foreground to background? Write down the steps (10 points)
Thank you!
Explanation / Answer
1.
LINUX PROCESS STATE CODES
D uninterruptible sleep (usually IO)
R runnable (on run queue)
S sleeping
T traced or stopped
Z a defunct ("zombie") process
W has no resident pages
< high-priority process
N low-priority task
L has pages locked into memory (for real-time and custom IO)
2.
Spawning a new process is when UNIX creates a new process:
1. the kernel has to take an existing process and then copy all of it into another part of memory.
2. Next it creates kernel entries to support the new process.
3. Finally it gives control of the cpu to user space in the new process.
Steps 1-3 is what fork() does, it is commonly called spawning a new process.Some of the UNIX command used to spawn a new process are:
fork() spawns a new process.
posix_spawn()
spawns a new process.
clone() spawns a new process.
system() spawns a new process.
3.
To determine what processes are owned by the current login user, we can use any of the following command:
1. top
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.