Preview

Chapter3 OS Essentials

Good Essays
Open Document
Open Document
619 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Chapter3 OS Essentials
CHAPTER 3

Exercises

3.6 What are the differences among short-term, medium term, and long-term scheduling?

Answer:

The short-term scheduler selects from the ready processes the next process to run and gives it the CPU. The long-term scheduler selects from the pool of processes that are waiting on disk and loads the selected processes into memory. These processes have not yet begun their execution. The medium-term scheduler takes processes that are currently in memory and selects those to be swapped out to disk. These processes will be swapped back in at a later point. This is done to improve process mix or because of memory requirements like overcommitted and needs to free up memory.

A primary difference is in the frequency of their execution. The short-term scheduler must select a new process quite often. Long-term is used much less often since it handles placing jobs in the system and may wait a while for a job to finish before it admits another one.

3.7. Describe the actions taken by a kernel to context-switch between processes. Answer:

The kernel saves the state of the currently executing process into its Process Control Block (PCB ). The state includes the values of all registers, process ID, memory information, list of open files, and so forth. It then reloads the context of a previously suspended process and sets the instruction counter to the restored processes next instruction.

3.8 Construct a process tree similar to Figure 3.9. To obtain process information for the UNIX or Linux system, use the command ps -ael. Use the command man ps to get more information about the ps command. On Windows systems, you will have to use the task manager.

Answer:

3.9 Including the initial parent process, how many processes are created by the program shown in Figure 3.28?

Answer: 8 processes are created. The program online includes printf() statements to better understand how many processes have been created.

3.10 Using

You May Also Find These Documents Helpful

  • Better Essays

    Nt1310 Unit 4

    • 3614 Words
    • 15 Pages

    13. If the following program (myprog) is run from the command line as myprog monday tuesday wednesday thursday? What would be the output?…

    • 3614 Words
    • 15 Pages
    Better Essays
  • Good Essays

    Unix processes are instances of an executed program. UNIX, being a multi task operating system handles thousands of processes at a time. We are able to check on what processes are currently running by typing ps at the UNIX prompt. Depending on the options used with the ps command, we can see different outcomes such as $ps -ef | more. This will list all the processes in the system. Some items you might see using the ps command are PID which is the process ID number, TT or TTY shows the controlling terminal for the process. If there is no controlling terminal then a question mark is used.…

    • 567 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Unit 59 Assignment 3

    • 645 Words
    • 3 Pages

    The process of how the subroutine works within an operating environment is as follows. While the main part of the program is running, there will be a call command sent to the CPU to tell it to stop wherever the program is at, store the W, Z and status along with where in the main program the CPU is at in the stack. Then the main program is cleared from memory and the subroutine is loaded for the CPU to start processing the code. Once the subroutine has finished, the subroutine code is deleted from memory and the CPU will load up the main program back on and will retrieve from stack the stored information (W, Z and status) which will allow the CPU know exactly where it needs to start from.…

    • 645 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Unit 3 network discovery

    • 1031 Words
    • 5 Pages

    What is the PID number? Why are these numbers useful when you run processes in the background? Which utility displays the PID numbers of the commands you are running?…

    • 1031 Words
    • 5 Pages
    Powerful Essays
  • Powerful Essays

    Nt1330 Unit 1 Study Guide

    • 2629 Words
    • 11 Pages

    CPU scheduler is to selects from among the processes in memory ready to execute and allocates the CPU to one of them. CPU scheduling decisions may take place when a process:…

    • 2629 Words
    • 11 Pages
    Powerful Essays
  • Satisfactory Essays

    What UID and PID have the highest amount of physical memory a process has used and is not swapped out? Show all processes and full output.…

    • 266 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    2. It only runs as many times as you have instructed the program to run…

    • 351 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    The operating systems job is managing the memory. The operating system is in charge of bringing this process into main memory (Stallings, 2012). However the processor must deal with references within the program. Branch instructions include an address to reference the order to be executed next. Data reference instructions include the address of the byte or word of data referenced. The processor hardware and operating system software must be able to translate the memory references found in the code of the program into actual physical memory addresses, reflecting the current location of the program in main memory. (Stallings, 2012).…

    • 573 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Nt1310 Unit 3 Os

    • 1341 Words
    • 6 Pages

    +• Scheduling: Any processor may perform scheduling, which complicates the task of enforcing a scheduling policy and assuring that corruption of the scheduler data structures is avoided. If kernel-level multithreading is used, then the opportunity exists to schedule multiple threads from the same process simultaneously on multiple processors.…

    • 1341 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    2. Which processes are not represented? How could the model be altered to include these processes?…

    • 334 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    2. Decompose each of the core processes in figure 6-2 and draw a new DFD for each core process.…

    • 418 Words
    • 2 Pages
    Good Essays
  • Good Essays

    11. An OS’s capability to run more than one application or process at the same time is referred to which of the…

    • 2490 Words
    • 10 Pages
    Good Essays
  • Satisfactory Essays

    Science 201

    • 366 Words
    • 2 Pages

    2. Which processes are not represented? How could the model be altered to include these processes?…

    • 366 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Eco/539 Week 4

    • 764 Words
    • 4 Pages

    Chapter 15 – Discussion Question #12, page 610: What are the advantages to finite capacity scheduling? By providing the scheduler with interactive computing and graphic output.…

    • 764 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    unit 4

    • 691 Words
    • 4 Pages

    Its executed and returned back to the point in the main program where it was sidetracked from…

    • 691 Words
    • 4 Pages
    Satisfactory Essays