Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Tests  >  Test: Threads- 2 - Computer Science Engineering (CSE) MCQ

Test: Threads- 2 - Computer Science Engineering (CSE) MCQ


Test Description

20 Questions MCQ Test - Test: Threads- 2

Test: Threads- 2 for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Test: Threads- 2 questions and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus.The Test: Threads- 2 MCQs are made for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Threads- 2 below.
Solutions of Test: Threads- 2 questions in English are available as part of our course for Computer Science Engineering (CSE) & Test: Threads- 2 solutions in Hindi for Computer Science Engineering (CSE) course. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free. Attempt Test: Threads- 2 | 20 questions in 55 minutes | Mock test for Computer Science Engineering (CSE) preparation | Free important questions MCQ to study for Computer Science Engineering (CSE) Exam | Download free PDF with solutions
Test: Threads- 2 - Question 1

Which of the following is/are not shared by all the threads in a process?

I. Program Counter

II. Stack

III. Registers

IV. Address space

Detailed Solution for Test: Threads- 2 - Question 1

Every thread have its own stack, register, and PC, so only address space that is shared by all thread for a single process. Option (C) is correct.

Test: Threads- 2 - Question 2

Consider the set of processes with arrival time(in milliseconds), CPU burst time (in milliseconds), and priority(0 is the highest priority) shown below. None of the processes have I/O burst time.

g2017_12

The waiting time (in milliseconds) of process P1 using preemptive priority scheduling algorithm is ____.

Detailed Solution for Test: Threads- 2 - Question 2

The gantt chart is using preemptive priority scheduling algorithm:

12

Waiting Time = Completion time - Arrival time - Burst Time Therefore, waiting time of process P1 is = 49 - 0 - 11 = 38 So, option (C) is correct.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Threads- 2 - Question 3

Consider three CPU intensive processes, which require 10, 20, 30 units and arrive at times 0, 2, 6 respectively. How many context switches are needed if shortest remaining time first is implemented? Context switch at 0 is included but context switch at end is ignored

Detailed Solution for Test: Threads- 2 - Question 3

Let three process be P0, P1 and P2 with arrival times 0, 2 and 6 respectively and CPU burst times 10, 20 and 30 respectively. At time 0, P0 is the only available process so it runs. At time 2, P1 arrives, but P0 has the shortest remaining time, so it continues. At time 6, P2 also arrives, but P0 still has the shortest remaining time, so it continues. At time 10, P1 is scheduled as it is the shortest remaining time process. At time 30, P2 is scheduled.

Test: Threads- 2 - Question 4

Two atomic operations permissible on Semaphores are __________ and __________.

Detailed Solution for Test: Threads- 2 - Question 4

Wait and signal are the atomic operation possible on semaphore.

Test: Threads- 2 - Question 5

User level threads are threads that are visible to the programmer and are unknown to the kernel. The operating system kernel supports and manages kernel level threads. Three different types of models relate user and kernel level threads. Which of the following statements is/are true ?

(a)

(i) The Many - to - one model maps many user threads to one kernel thread

(ii) The one - to - one model maps one user thread to one kernel thread

(iii) The many - to - many model maps many user threads to smaller or equal kernel threads

(b)

(i) Many - to - one model maps many kernel threads to one user thread

(ii) One - to - one model maps one kernel thread to one user thread

(iii) Many - to - many model maps many kernel threads to smaller or equal user threads

Detailed Solution for Test: Threads- 2 - Question 5

(a) (i) The Many - to - one model maps many user threads to one kernel thread (ii) The one - to - one model maps one user thread to one kernel thread (iii) The many - to - many model maps many user threads to smaller or equal kernel threads

(b) (i) Many - to - one model maps many kernel threads to one user thread (ii) One - to - one model maps one kernel thread to one user thread (iii) Many - to - many model maps many kernel threads to smaller or equal user threads All satement are correct. So, option (A) is correct.

Test: Threads- 2 - Question 6

At particular time, the value of a counting semaphore is 10, it will become 7 after: (a) 3 V operations (b) 3 P operations (c) 5 V operations and 2 P operations (d) 2 V operations and 5 P operations Which of the following option is correct?

Detailed Solution for Test: Threads- 2 - Question 6

P: Wait operation decrements the value of the counting semaphore by 1. V: Signal operation increments the value of counting semaphore by 1. Current value of the counting semaphore = 10 a) after 3 P operations, value of semaphore = 10-3 = 7 d) after 2 v operations, and 5 operations value of semaphore = 10 + 2 - 5 = 7 Hence option (C) is correct.

Test: Threads- 2 - Question 7

At a particular time of computation the value of a counting semaphore is 7. Then 20 P operations and xV operations were completed on this semaphore. If the new value of semaphore is 5 ,x will be

Detailed Solution for Test: Threads- 2 - Question 7

P operation : Decrements the value of semaphore by 1 V operation : Increments the value of semaphore by 1 Initially, value of semaphore = 7 After 20 P operations, value of semaphore = 7 - 20 = -13 Now, after xV operations, value of semaphore = 5 -13 + xV = 5 xV = 5 + 13 = 18 So, option (A) is correct.

Test: Threads- 2 - Question 8

Names of some of the Operating Systems are given below:

(a) MS-DOS

(b) XENIX

(c) OS/2

In the above list, following operating systems didn’t provide multiuser facility.

Detailed Solution for Test: Threads- 2 - Question 8

MS-DOS is an operating system for x86-based personal computers mostly developed by Microsoft. It doesn't provide multi-user facility. XENIX is a discontinued version of the Unix operating system for various microcomputer platforms, licensed by Microsoft from AT&T Corporation. It doesn't provide multi-user facility. OS/2 is a series of computer operating systems, initially created by Microsoft and IBM. It doesn't provide multi-user facility. So, Option (D) is correct.

Test: Threads- 2 - Question 9

One of the disadvantages of user level threads compared to Kernel level threads is

Detailed Solution for Test: Threads- 2 - Question 9

Advantage of User level thread:

1- Scheduling is application dependent.

2- Thread switching doesn’t require kernel mode privileges.

3- The library procedures invoked for thread management in user level threads are local procedures.

4- User level threads are fast to create and manage.

5- User level thread can run on any operating system.

Disadvantage of User-level thread:

1- Most system calls are blocked on a typical OS.

2- Multiprocessing is not supported for multi-threaded application.

So, Option (A) is correct.

Test: Threads- 2 - Question 10

Consider a system having ‘m’ resources of the same type. These resources are shared by three processes P1, Pand P3 which have peak demands of 2, 5 and 7 resources respectively. For what value of ‘m’ deadlock will not occur ?

Test: Threads- 2 - Question 11

Suppose there are four processes in execution with 12 instances of a Resource R in a system. The maximum need of each process and current allocation are given below:

37 (2)

With reference to current allocation, is system safe ? If so, what is the safe sequence ?

Detailed Solution for Test: Threads- 2 - Question 11

Current allocation of P1P2P3P4 are 3, 4, 2, 1 which is 10 in total. We have 12 total no of resources and out of them 10 are allocated so, we have only 2 resources. There is 5, 5, 3, 2 resources are needed for P1P2P3P4 respectively. So, P4 will run first and free 3 resources after execution. Which are sufficient for P3 So it will execute and do free 5 resources. Now P1 and P2 both require 5 resources each So we can execute any of them first but we will give priority to P1. The execution order will be P4P3P1P2.

SO, option (C) is correct.

Test: Threads- 2 - Question 12

An Operating System (OS) crashes on the average once in 30 days, that is, the Mean Time Between Failures (MTBF) = 30 days. When this happens, it takes 10 minutes to recover the OS, that is, the Mean Time To Repair (MTTR) = 10 minutes. The availability of the OS with these reliability figures is approximately :

Detailed Solution for Test: Threads- 2 - Question 12

System crashes once in 30 days and need 10 minutes to get repaired. Either convert 30 days into minute or 10 minute into days 30 days = 30 ∗ 24 ∗ 60 minute fraction of time system is not available = (10 / (30 ∗ 24 ∗ 60 )) ∗ 100 = 0.023% Availability = 100 - 0.023 = 99.97%

So, option (D) is correct.

Test: Threads- 2 - Question 13

A CPU scheduling algorithm determines an order for the execution of its scheduled processes. Given 'n' processes to be scheduled on one processor, how many possible different schedules are there?

Detailed Solution for Test: Threads- 2 - Question 13

For 'n' processes to be scheduled on one processor, there can be n! different schedules possible. Example: Suppose an OS has 4 processes to schedule P1, P2, P3 and P4. For scheduling the first process, it has 4 choices, then from the remaining three processes it can take 3 choices, and so on. So, total schedules possible are 4*3*2*1 = 4!

Option (C) is correct.

Test: Threads- 2 - Question 14

The state of a process after it encounters an I/O instruction is

Detailed Solution for Test: Threads- 2 - Question 14

Whenever a process is just created, it is kept in Ready queue. When it starts execution, it is in Running state, as soon as it starts doing input/output operation, it is kept in the blocked state.

Test: Threads- 2 - Question 15

A starvation free job scheduling policy guarantees that no job indefinitely waits for a service. Which of the following job scheduling policies is starvation free?

Detailed Solution for Test: Threads- 2 - Question 15

Round Robin is a starvation free scheduling algorithm as it imposes a strict time bound on the response time of each process i.e. for a system with 'n' processes running in a round robin system with time quanta tq, no process will wait for more than (n-1) tq time units to get its CPU turn. Option (D) is correct.

Test: Threads- 2 - Question 16

System calls are usually invoked by using :

Detailed Solution for Test: Threads- 2 - Question 16
  • System calls are usually invoked by using a software interrupt.
  • Polling is the process where the computer or controlling device waits for an external device to check for its readiness or state, often with low-level hardware.
  • Privileged instruction is an instruction (usually in machine code) that can be executed only by the operating system in a specific mode.
  • In direct jump, the target address (i.e. its relative offset value) is encoded into the jump instruction itself.

So, option (C) is correct.

Test: Threads- 2 - Question 17

Which of the following strategy is employed for overcoming the priority inversion problem?

Detailed Solution for Test: Threads- 2 - Question 17

Priority inversion is a scenario in scheduling when a higher priority process is indirectly preempted by a lower priority process, thereby inverting the relative priorities of the process. This problem can be eliminated by temporarily raising the priority of lower priority level process, so that it can not preempt the higher priority process.

Option (A) is correct.

Test: Threads- 2 - Question 18

A disk drive has 100 cyclinders, numbered 0 to 99. Disk requests come to the disk driver for cyclinders 12, 26, 24, 4, 42, 8 and 50 in that order. The driver is currently serving a request at cyclinder 24. A seek takes 6 msec per cyclinder moved. How much seek time is needed for shortest seek time first (SSTF) algorithm?

Detailed Solution for Test: Threads- 2 - Question 18

36 (4)

seek time = 2 =(2 + 14 + 4 + 4 + 38 + 8) = 420 msec 1000 msec = 1 sec 420 msec = 0.42 sec So, option (D) is correct.

Test: Threads- 2 - Question 19

In an operating system, indivisibility of operation means:

Detailed Solution for Test: Threads- 2 - Question 19

In an operating system, indivisibility of operation means processor can not be pre-empted. One a process starts its execution it will not suspended or stop its execution inside the processor.

So, option (C) is correct.

Test: Threads- 2 - Question 20

The performance of Round Robin algorithm depends heavily on

Detailed Solution for Test: Threads- 2 - Question 20

In round robin algorithm, the size of time quanta plays a very important role as: If size of quanta is too small: Context switches will increase and it is counted as the waste time, so CPU utilization will decrease. If size of quanta is too large: Larger time quanta will lead to Round robin regenerated into FCFS scheduling algorithm. So, option (D) is correct.

Information about Test: Threads- 2 Page
In this test you can find the Exam questions for Test: Threads- 2 solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Threads- 2, EduRev gives you an ample number of Online tests for practice

Top Courses for Computer Science Engineering (CSE)

Download as PDF

Top Courses for Computer Science Engineering (CSE)