Preview

operating system

Satisfactory Essays
Open Document
Open Document
778 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
operating system
3.2 Including the initial parent process, how many processes are created by the program shown in Figure 3.31?
#include <stdio.h>
#include <unistd.h> int main()
{
/* fork a child process */ fork(); /* fork another child process */ fork(); /* and fork another */ fork(); return 0;
}
Figure 3.31 How many processes are created?
Sol: To know how many processes are created we modified the program using getpid() and printf(). Please find the modified program below
#include <stdio.h>
#include <unistd.h> int main()
{
pid_t pid;
/* fork a child process */ fork(); /* fork another child process */ fork(); /* and fork another */ fork(); pid = getpid(); printf("Process : pid = %d \n",pid); return 0;
}
Output : Number of process = 8.

3.8 Describe the differences among short-term, medium-term, and longterm scheduling. Sol:
Scheduler : A process moves among different scheduling queues throughout its lifetime. Operating system takes care of selecting the processes from these queues in some fashion. Selecting process is done by the the appropriate scheduler.
Types of scheduling:
Short - term (or) CPU Scheduler
Medium – term
Long – term (or) Job Scheduler
Short – Term Scheduler: Short term scheduler selects the processes that are ready to execute and allocates CPU to one of them.
Medium – Term Scheduler: Medium term scheduler is introduced by some operating systems such as time sharing systems. Medium term scheduler can remove a process from the memory and decrease the degree of multiprogramming and the same process can be later reintroduced into the memory and its execution can be started where it was stopped.
Long – Term Scheduler: Some processes are submitted than can be executed and these processes are pooled into the mass storage device. Long term scheduler selects processes from these pool and loads them into the memory for execution.

3.14 Using the program in Figure 3.34, identify the values of pid

You May Also Find These Documents Helpful

  • Satisfactory Essays

    It gets the information of number of tasks and the softwares required and puts it into a HashMap softwareTaskMap. In case, the number of tasks is more than the available resources that can perform the task, the system gets ready for a multiple execution.…

    • 464 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Nt1310 Unit 1 Study Guide

    • 378 Words
    • 2 Pages

    _____________ is the ability of a central processing unit (CPU) or a single core in a multi-core processor to execute multiple processesor threads concurrently…

    • 378 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Unit 3 network discovery

    • 1031 Words
    • 5 Pages

    The shell tries to find an executable program with the same name as the command. When it does, the shell executes the program. When finishing the command put an & ampersand symbol at the end of the command and the command will run in the background. Then a cursor will be displayed immediately to allow the next command to be entered.…

    • 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
  • 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
  • Good Essays

    Memory management is an important characteristic of an operating system. Main memory is divided into two parts one for resident programs, and the other for the program currently in use. The user part must be subdivided to accommodate multiple processes (Stallings, 2012). When a few processes are in the memory then much of the time all of the processes will have to wait for input /output and the processor will be idle. According to Stallings (2012),. The requirements that memory management is supposed to satisfy are Relocation, Protection, Sharing, Logical organization, and Physical…

    • 573 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    If using a long listing and no process modifiers, what is the swap space amount for the bash command?…

    • 266 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Operating System

    • 1099 Words
    • 5 Pages

    Answer: d. It redirects the output of one command to the input of another command.…

    • 1099 Words
    • 5 Pages
    Good Essays
  • Powerful Essays

    Linux Interview Questions

    • 10428 Words
    • 42 Pages

    13. What happens to a child process that dies and has no parent process to wait for it and what’s bad about this?…

    • 10428 Words
    • 42 Pages
    Powerful Essays
  • Powerful Essays

    Manufacturing Mountain Bike

    • 10977 Words
    • 44 Pages

    For the subject SME2713 Manufacturing Process, we have been assigned to do a group assignment for the parts of a mountain bike. The main objectives of this group assignment are to train students in acquiring and organizing information. Besides that, it is also set for the purpose of training students in technical report writing and working in a team. Other than that, this group assignment also helps the students to improve the knowledge and understanding with regards to the field of study. The part of a mountain bike that our group assigned is the crankset.…

    • 10977 Words
    • 44 Pages
    Powerful Essays
  • Better Essays

    It325 Assignment 7

    • 1251 Words
    • 6 Pages

    Within each process the statements are executed sequentially, but statements from different processes can be interleaved in any order that's consistent with the constraints imposed by the semaphores. When answering the questions below assume that once execution begins, the processes will be allowed to run until all 3 processes are stuck in a wait() statement, at which point execution is halted.…

    • 1251 Words
    • 6 Pages
    Better Essays
  • Powerful Essays

    Oracle Pcp

    • 6458 Words
    • 26 Pages

    Allows scheduling of jobs – batch jobs, or Requests in Oracle terms. Processes concurrent programs as a Request. Requests can be grouped together into Request Sets. Different types of concurrent managers handle different types of requests. A concurrent program can be assigned to a responsibility, and that responsibility can be assigned to users, allowing them the permission to run the concurrent program. Concurrent managers may have limits on the concurrent programs that can be run, and the times that they can be started. Requests have priorities, status and log and out files in the above directory…

    • 6458 Words
    • 26 Pages
    Powerful Essays
  • Better Essays

    Time driven is a computer programming pattern which controls the flow of a program by being driven by a clock and is used in real time. A program is always divided into sets of tasks that have to be regularly activated. The pattern of the activation is stored in a table which has rules with schedule of when to run a certain tasks.…

    • 1433 Words
    • 4 Pages
    Better Essays
  • Good Essays

    Scheduling

    • 338 Words
    • 2 Pages

    Scheduling refers to the pattern of advertising timing, represented as plots on a yearly flowchart. These plots indicate the pattern of scheduled times advertising must appear to coincide with favorable selling periods. The classic scheduling models are Continuity, Flighting and Pulsing.…

    • 338 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Deadlock

    • 779 Words
    • 4 Pages

    *The hold and wait or resource holding conditions may be removed by requiring processes to request all the resources they will need before starting up (or before embarking upon a particular set of operations). This advance knowledge is frequently difficult to satisfy and, in any case, is an inefficient use of resources. Another way is to require processes to request resources only when it has none. Thus, first they must release all their currently held resources before requesting all the resources they will need from scratch. This too is often impractical. It is so because resources may be…

    • 779 Words
    • 4 Pages
    Good Essays

Related Topics