Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Pro Blog
  • Users
  • Groups
  • Unsolved
  • Solved
Collapse
Secnto AI
  1. Secnto AI
  2. Categories
  3. Virtual University
  4. CS604 - Operating Systems
  5. McQ Solved for Mid Tearm and Final Term
McQ Solved for Mid Tearm and Final Term
M moaaz

If a system is not in a safe state, there can be No deadlocks.
►True
►False(Page 137)
A dashed line is used to represent a _________ in Resource Allocation Graph.
►Claim edge (Page 138)
►Request edge
►Assignment edge
►Allocation edge
The process of holding at least one resource and waiting to acquire additional resources that are currently
being held by other processes is known as________.
►Mutual exclusion
►Hold and wait (Page 131)
►No preemption
►Circular wait
In Resource Allocation Graph, A _______ Pi →Rj indicates that process Pi may request resource Rj at some
time in the future.
►Claim edge (Page 138)
►Request edge
►Assignment edge
►Allocation edge
If the system can allocate resources to each process in some order and still avoid a deadlock then it said to
be in ______ state.
►Safe (Page 137)
►Unsafe
►Mutual
►Starvation
A condition where a set of blocked processes each holding a resource and waiting to acquire a resource
held by another process in the set is termed as ________.
►Deadlock (Page 130)
►Starvation
The following is NOT a classical problem of synchronization
►Bounded buffer problem
►Reader writer problem
►Dining philosopher‟s problem
►Counting semaphore problem (Page 118)
(MCQZ-CS604 Operating Systems)
(No repeated Questions) April 2014
(MCS Students: MC120202589/MC120201756)
Virtual University Of Pakistan
[email protected], [email protected]
The integer value of ________semaphores can range over an unrestricted integer domain.
►Counting (Page 117)
►Binary
►Mutex
►Bounded buffer
The condition in which a set {P0, P1… Pn} of waiting processes must exist such that P0 is waiting for a
resource that is held by P1, P1 is waiting for a resource that is held by P2, and so on, Pn-1 is waiting for a
resource held by Pn, and Pn is waiting for a resource held by P0. This condition is known as
______________.
►Mutual exclusion
►Hold and wait
►No preemption
►Circular wait (Page 131)
You can use the rm file1 command to __________ file1
►Retrieve
►Remove (Page 30)
►Make
►modify
The correct command for compiling C program named program.c in Linux environment is
►gcc program.c -o FirstPrgram (Page 31)
►gcc -o FirstProgram program.c
►gcc -z FirstProgram program.c
►gcc program.c -m FirstPrgram
Using _________system, we can create a new process in Linux.
►Fork (Page 39)
► exec
►wait
►exit
Cooperating processes never share any data, code, memory or state.
►True
►False(Page 5)
Question No: 5 of 10 ( Marks: 1 ) - Please choose one
____ command display the status of a process.
►ls
►ps (Page 66)
►gcc
►cat

Swapper is also termed as Short term scheduler.
►True
►False(Page 36)
_____ system call is used to write to a file or FIFO or any other IPC channel.
►read
►write(Page 48)
►open
►fork
A Process „A‟ that has finished working but its parent process has also finished its execution. In this
state the process „A‟ will be called as _____ process.
►Child
►Thread
►Zombie (Page 42)
►Fork
_________________ scheduling allows a process to move between queues.
►Round Robin
►First Come First Serve
►Multilevel Feedback Queue (Page 92)
►Shortest Remaining Time First
Kernel is responsible for scheduling the user level threads.
►True
►False (Page 73)
A ---------------- (or an exception) is a software-generated interrupt caused either by an error (division by
zero or invalid memory access) or by a user request for an operating system service.
► Interrupt
► Trap (Page 10)
► Signal
► Process
Which register holds the smallest legal physical memory address for a process?
► Base register (Page 13)
► Limit register
► Status register
► None of the given options
The --------------semaphore provides mutual exclusion for accesses to the buffer pool and is initialized to
the value 1.
► mutex (Page 118)
► binary
► couting
► none of the given options
Binary semaphores are those that have only two values---------
► 0 and n
► 0 and 0
► 0 and 1 (Page 117)
► None of the given options
Physical memory is broken down into fixed-sized blocks, called----------- and Logical memory is divided
into blocks of the same size, called -----------
► Frames, pages (Page 165)
► Pages, Frames
► Frames, holes
► Holes, segments
A page table needed for keeping track of pages of the page table is called --------------
► 2-level paging
► Page directory (Page 173)
► Page size
► Page table size
The address generated by the CPU, after any indexing or other addressing-mode arithmetic, is called a —
-----address, and the address it gets translated to by the MMU is called a ---------address.
►Virtual, physical click here for detail
► Hexadecimal, Binary,
► Valid, invalid
► Physical, Virtual
Each page is a power of -------- bytes long in paging scheme.
► 2
► 3
► 4 (Page 167)
► 5
Which part of the computer system helps in managing the file and memory management system?
► Operating System (Page 5)
► Device Drivers
► Application Software
► Hardware
Which of the following is correct definition for wait operation?
► wait(S) { (Page 111)

while(S<=0)
;// no o
S–;
}
► wait(S) {
S++;
}
► wait(S) {
while(S>=0)
;// no op
S–;
}
► wait(S) {
S–;
}
In deadlock detection and recovery algorithm, a deadlock exists in the system if and only if the wait for
graph contains a _____________
► Cycle (Page 147)
► Graph
► Edge
► Node
------------ register contains the size of the process
►Base register
►Index register
►Limit register (Page 13)
►Stack pointers register
The -----------scheme is not applicable to a resource allocation system with multiple instances of each
resource type.
►Wait for graph (Page 148)
►Resource allocation graph
►Both Resource-allocation and wait-for graph ► None of the given options
___________ algorithm is used in Deadlock avoidance.
►Bakery
►Banker‟s (Page 139)
►Mutual exclusion
►Safe Sequence
What do we name to an address that is loaded into the memory-address register of the memory?
►Logical address
►Physical address (Page 155)
►Binary addresses
►None of the given options

Cache is non-volatile memory.
►True
►False (Page 153)
A system call________
►Is an entry point into the kernel code (Page 18)
►Allows a program to request a kernel service
►Is a technique to protect I/O devices and other system resources
►All of the these
The condition where a set of blocked processes each holding a resource and waiting to acquire a resource
held by another process in the set, is termed as ________.
►Deadlock (Page 130)
►Starvation
Banker‟s algorithm is used for ________________
►Deadlock avoidance (Page 140)
►Deadlock detection
►Deadlock prevention
►Deadlock removal
The ________ requires that once a writer is ready, that writer performs its write as soon as possible , if a
writer waiting to access the object, no new readers may start reading.
first readers-writers problem
►second readers-writers problem (Page 119)
►third readers-writers problem
►fourth readers-writers problem
________________ is an integer variable accessible through wait and signal which are atomic operations.
►Semaphore (Page 111)
►Mutex
►Busy w aiting
►Signal
The integer value of _________ semaphores can not be greater than 1.
►Counting
►Binary (Page 117)
►Mutex
►Bounded buffer
Starvation is infinite blocking caused due to unavailability of resources.
►True (Page 115)
►False

Operating System provides services such as Managing Primary and Secondary Storage, Processes and
Allowing user to manage his/her files and directories.
►True (Page 5)
►False
___________ is used in real time operating systems.
►Non-preemptive scheduling Click here for detail
►Preemptive scheduling
►Dispatching scheduling
►FCFS scheduling
Preventing a condition of ________ to happen, deadlocks can be prevented to happen.
►Critical region
►Circular wait (Page 136)
►Monitors
►Critical section
The problem with priority scheduling algorithm is ________.
 Deadlock
 Starvation (Page# 84)
 Aging
 Nice value
Kernel threads are supported directly by the operating system. The kernel performs
the scheduling, creation, and management in ------ command display the status of a
process.
 ls
 ps (Page# 63)
 gcc
 cat
_______________ scheduling algorithm can be preemptive or non-preemptive.
 First Come First Serve
 Shortest Job First (Page # 83)
 Round Robin
 Priority
Round Robin algorithm is most suitable for __________.
 Time sharing system (Page # 86)
 Real time systems and batch systems
 Running Batch programs

 Expert system
The critical section problem can‟t be solved by the following except
 Software based solution
 Firmware based solution (Page# 99)
 Operating system based solution
 Hardware based solution
Mkfifo () is a _______.
 System Call
 Command
 Directory
 None of Above (Page# 57)
Preemptive ----------------scheduling is sometimes called shortest remaining-time-first scheduling.
 First-Come-First-Served (FCFS)
 Round-Robin
 Sorted Job First (SJF) (Page# 83)
 Priority
rm and rmkdir commands are used to _____________ directory.
 Create
 Move
 Remove(Page# 27)
 Modify
Linux is only single user operating system
 True
 False (Page# 4)
____________ command is used to change the directory.
 Ls
 Cp
 Cd (Page# 23)
 mv
______________ is used to request the OS by the process to take an I/O or initiating child process.
System call
Interrupt
Trap
Signal

A parent process calling __________ system call will be suspended until children process terminates.
Select correct option:
wait
fork
exit
exec
In producer-Consumer problem synchronization is required. On which shared area this
synchronization actually affect?
 Counter
 Buffer (Page #45)
 Entry section
 Exit section
Which could not be the advantage of thread?
 Separate address space
 Quick response
 Economical
 Best in multiprocessing environment
Using hardware solution to synchronization for complex problems, introduce a new
synchronization tool know as _______________.
 TestAndSet
 Semaphore (Page No. 111 )
 Swap
 Trap
In instruction TestAndSet mutual exclusion implementation is done by declaring a Boolean
variable lock ______________.
 Initialized as zero
 Initialized as true
 Initialized as 1
 Initialized as false (Page No. 109)
Use of semaphore create a problem of busy waiting, this wastes CPU cycles that some other
process may be able to use productively. This type of semaphore is also called ______________
 Semaphore S
 Spinlock (Page No. 112 )
 Locking Semaphore
 Mutex

------------- is a segment of code that accesses a shared resource like data structure or device
that must not be concurrently accessed by more than one thread of execution.
 Multithreading
 Context switching
 Critical section (Page No. 105, click here for details )
 Pipelining
Critical section is a place where certain shared structure is updated. Its solution required
certain precaution; one of them is the access to critical section by one process at a time only.
What this condition is termed as?
 Progress
 Entry section
 Bounded waiting
 Mutual exclusion
A solution to the critical section problem must satisfy the following requirements except
 Progress
 Mutual Exclusion
 Bounded Waiting
 Race Condition
Keep in mind scheduling algorithm, when you go to any famous fast food franchise .On
entering the store, each customer receives a number. The customer with the lowest number is
served next. This algorithm is called-------------.
 Dijkastra algorithm
 Simple algorithm
 Deadlock algorithm
 Bakery algorithm
While executing the statement c++/c-- in Producer-Consumer problem, at back end certain
number of instructions are executed, if interleaving of statements happen, it create race
condition. Tell number of instructions that require “no interleaving” while executing c++/c–?
 3
 1
 2
 0
User mode can run the Privileged instructions.
Select correct option:
True
False

In Unix/Linux environment, Ayesha wants to know the complete picture of current processes
in her session. Which of the following command will help her in this regard?
Select correct option:
$ ps
$ gcc
$ top
$ fifo
When processes are generated using fork () system call and then after that they are
coordinated with each other using IPC channel. They are utilizing a separate address space for
each of process (parent, child), kernel resources and IPC channel. This makes it a more heavy.
Which strategy can be used to make it light?
Select correct option:
Termination of child process when these become more
Scheduling of each process
Use of threads
Use of Batch systems
In process management, some of the jobs can be suspended for some time in order to give other
jobs a chance to be in execution. Which command can be used to place back a suspended
program?
Select correct option:
Fg
Top
Ps
Bg
When sender never block because it has an infinite length storage area, then it means it is
holding a queue of _____________ capacity.
Select correct option:
Zero
Unbounded
Defined
Bounded
In system call that creates a pipe for IPC. If one of the operation from read/write would fail
then what will be returned as result?
Select correct option:
-1,+1
-1 (page 57)
1
0
To terminate a process is pressed, which signal it actually pass to process for
termination?
Select correct option:
SIGTERM
SIGINT
SIGKILL
SIGTRAP
A Process „A‟ that has finished working but its parent process has also finished its execution.
In this state the process „A‟ will be called as _____ process.
Select correct option:
Child
Thread
Zombie
Fork
While using the read/write system call which data type is use to return the size of file to buffer
from file descriptor fd?
Select correct option:
Pipefd
SIZE_MAX
FIFO
Ssize_t (page45)
In Unix/Linux ------------- are used for client server communication to pass data between a
server process and client processes.
Select correct option:
FIFO (page 60)
LIFO
Read()
Write()
Consider a scenario of CPU protection, ----------- is added to the operating system in order to
detect and avoid loop in a user program.
Select correct option:
I/O
Timer
Base and limit registers
Turning interrupt enable off
Thread that is not executed for servicing a request by a user thread .It is named as -------------.
EINVAL
EAGAIN
LWP
POSIX
Consider three processes in scheduling. Here are the waiting times for three processes
P1=4,P2=2,P3=6.Which one of is correct average waiting time per process?
4 (page 81)
6
2
3
In Unix/Linux environment Ali want to know the number of processes running on the system and their
status, number of CPUs in the system and their usage, amount of main memory and its usage. Which of
the following command will help in this regard?
 $ ps
 $ gcc
 $ fifo
 $ top
In multi-threaded process thread () take two argument, they are used to take______________
and ___________.
 Program counter value, address space limit
 New thread ID, process name
 Register count, program counter
 New thread function name, new thread ID
Pipes simply used on the command line to connect the standard input of one process to the
standard input of another. Which of the following syntax is correct use of command line Linux
/UNIX pipes?
Select correct option:
cmd1 % cmd2% ……… %cmdN
cmd1 | cmd2 | … | cmdN (page 53)
cmd1 $ cmd2 $ …………… $ cmdN
cmd1 & cmd2 & ……………&cmdN
__________ commands in Linux helps to create a new directory.
Select correct option:
ls
cp
mv
mkdir
When processes communicate with each other, they perform communication through
synchronization and utilizing separate address spaces. This action is termed as


Select correct option:
Inter-process communication (page 67)
Process management
Synchronization
Direct/indirect communication
Ali is an operating system designer. One user requirement regarding OS is easy to debug and
modify. In your opinion which one of the following OS structure Ali needs to follow?
Select correct option:
Simple OS Approach
Micro kernels
Layered Approach
Virtual Machines
Given bellow two statements can be categorized in some sort of message passing techniques.
This type is named as ____________.
• Send (A, message) • Receive (B, message)
Synchronization
Direct communication
Explicit buffering
Send by copy communication
The TSL (TestAndSet instruction) which is the hardware solution to synchronization problem does
not satisfy the ________ condition, hence not considered to be a good solution.
Bounded waiting P/106
None
Mutual exclusion
Progress
The ------------system call is used to open or create a file.
Open () Google
Read ()
Write ()

Close ()
------------- Threads are implemented by a thread library.
Kernel thread
User thread pg 70
In client-server applications, __________ are used to pass data between a server process and client
processes.
FIFOs
Used by __________ commands o pass data from one shell pipeline to another, without creating
temporary files.
Shell
Fork system call is zero for the __________ process.
Child
__________ that define the ways in which system resources are used to solve the computing
problems of the users.
Applications programs
__________ is used to create a thread.
Thread ()
Which multi-threading models provides true concurrency __________ .
One-to-one
User level provided support for __________ .
User threads
In critical section problem each process must first request permission to enter its critical section,
the section of code implementing this request is called the __________ .

Entry section
2-Process and n-Process solutions to the Critical Section Problem are software solutions.
Software
Command Name interpreter is often known as the _______.
a. Register
b. Shell
c. Kernel
d. Timer
All jobs that enter into a ________system are kept in the job pool.
a. Single user.
b. Batch
c. Multiprogrammed
d. Time sharing system
Using _____ system call, we can create a new process in Unix.
a. Fork
b. Exec
c. Wait
d. Exit
Pipe system call is used to _________ a pipe.
a. Destroy
b. Create
c. Modify
d. Clear
To avoid race condition, the number of processes that may be simultaneously inside the critical
section is ___________.
a. 8
b. 1
c. 16
d. 0
A time interval when a process uses CPU only is called ______________.

a. Scheduling
b. I/O burst
c. CPU burst
d. Dispatch latency
The solution type where in critical section we use “entry section and “exit section” is called kind of
_______________.
Select correct option:
Hardware Solution
Assumption
Software Solution
Consider three processes in scheduling .Here are the waiting times for the three processes P1 = 5;
P2 = 10; P3 = 3. Which one of the following is correct average waiting time per process?
Select correct option:
3
2
18
6
Critical section problem can be solved by using how many ways?
Select correct option:
4
3 (page 101)
1
2
The section of code before the critical section is called __________
Select correct option:
Entry section
Remainder section
Exit section
Crystal section
The section of code after the critical section is called __________.
Select correct option:
Crystal section
Entry section
Remainder section
Exit section
_____________ algorithm is used for solving n-process critical section problem.
Select correct option:
Bankers
Bakery (page 105)
Babbles
None of the given
Consider a system of N processes (Po, P1 …… Pn-1). Each process in its critical section and the
process may be changing common variables, updating a table, writing a file etc. No other process is
allowed to execute in its critical section. This problem is called -------------
Select correct option:
Bakery algorithm
N-Mutual exclusion
N-Process Critical Section (page 105)
Deadlock algorithm
Consider three processes in scheduling .Here are the waiting times for the three processes P1 = 4;
P2 = 2; P3 = 6. Which one of the following is correct average waiting time per process?
Select correct option:
4
6
2
3
Clock interrupt handler is an example of kernel thread that is not executed for servicing by user
thread. It is named as
EInval
EAGAIN
LWP (I think)
PoSIX

Thanks for Sharing
(MCQs- Solved- CS604 Operating Systems)
(No repeated Questions) April 2014
(MCS Students: MC120202589/MC120201756)
Virtual University Of Pakistan
[email protected], [email protected]

CS604 - Operating Systems
9 Posts
0 Votes
CS604 Quiz#2 Solution and discussion
zaasmiZ zaasmi

CS604 Quiz#2.
Please post your current Quiz to help the students.

CS604 - Operating Systems
29 Posts
0 Votes
CS604 Assignment 3 Solution and Discussion
zaasmiZ zaasmi

Re: CS604 Assignment 3 Solution and Discussion

Operating Systems(CS604)
Assignment # 03
Spring 2020
Total marks = 15

Deadline Date
27th July 2020

Please carefully read the following instructions before attempting assignment.

RULES FOR MARKING
It should be clear that your assignment would not get any credit if:
 The assignment is submitted after the due date.
 The submitted assignment does not open or file is corrupt.
 Strict action will be taken if submitted solution is copied from any other student or from the internet.

You should consult the recommended books to clarify your concepts as handouts are not sufficient.

You are supposed to submit your assignment in .doc or docx format.
Any other formats like scan images, PDF, zip, rar, ppt and bmp etc will not be accepted.

Objective:
• The objective of this assignment is to learn deadlock avoidance algorithm.
• The objective of this assignment is to learn page addressing.

NOTE

No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.

If you find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.

For any query, feel free to email at:
[email protected]

Question No 01 15 marks
Consider the below given table showing the system state at a certain time. There are five processes P0 to P4 and four types of resources A, B, C and D. The resource allocation, max and available matrices for each process are also given in the table as shown below.

           Allocation 			    Max 		         Available
A 	B 	C 	D	A 	B 	C 	D 	A 	B      C      D
P0 	0 	0 	1 	2 	0 	0 	1 	2 	1 	5       2       0
P1 	1 	0 	0 	0 	1 	7 	5 	0
P2 	1 	3 	5 	4 	2 	3 	5 	6
P3 	0 	6 	3 	2 	0 	6 	5 	2
P4 	0 	0 	1 	4 	0 	6 	5 	6

Considering the Banker’s algorithm for deadlock avoidance, answer the following questions.

(a) Compute and show the Need matrix for processes in the system.
(b) Is the system in safe state? If YES, then show the safe sequence. If NOT in safe state, then explain the reason.

Wish you very best of luck!

CS604 - Operating Systems
2 Posts
0 Votes
CS604 Assignment 2 Solution and Discussion Spring 2020
zaasmiZ zaasmi

Re: CS604 Assignment 2 Solution and Discussion

Operating Systems (CS604)
Assignment # 02
Spring 2020
Total marks = 15

Deadline Date
14th June 2020

Please carefully read the following instructions before attempting assignment.

RULES FOR MARKING
It should be clear that your assignment would not get any credit if:
 The assignment is submitted after the due date.
 The submitted assignment does not open or file is corrupt.
 Strict action will be taken if submitted solution is copied from any other student or from the internet.

You should consult the recommended books to clarify your concepts as handouts are not sufficient.

You are supposed to submit your assignment in .doc or docx format.
Any other formats like scan images, PDF, zip, rar, ppt and bmp etc will not be accepted.

Objective:
• The objective of this assignment is to learn scheduling algorithm.
• To learn and understand different Operating System structure.

NOTE

No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.

If you find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.

For any query, feel free to email at:
[email protected]

Question No 01 15 marks
Consider the following set of processes, with the CPU burst time given in milliseconds:

Process Burst Time
P1 10
P2 1
P3 2
P4 1
P5 5

The processes are arrived in the order P1, P2, P3, P4, P5, all at time 0.

A. Draw Gantt chart showing the execution of these processes using FCFS and SJF scheduling.
B. Calculate the turnaround time of each process for FCFS scheduling algorithm as per part Calculation of part A?
C. Calculate the waiting time of each process for SJF scheduling algorithm as per calculation of Part A?

Wish you very Best of Luck!

CS604 - Operating Systems
5 Posts
0 Votes
CS604 GDB 1 solution and discussion Fall-2019
zareenZ zareen

Re: CS604 GDB 1 solution and discussion

CS604 - Operating Systems
1 Posts
0 Votes
CS604 Assignment 3 Solution and Discussion
zareenZ zareen

Operating Systems (CS604)
Assignment # 03
FALL 2019
Total marks = 20

Deadline Date
22nd Jan 2020

Please carefully read the following instructions before attempting assignment.

RULES FOR MARKING
It should be clear that your assignment would not get any credit if:
 The assignment is submitted after the due date.
 The submitted assignment file does not open or it is corrupt.
 The submitted assignment solution is copied from any other student or from the internet.

You should consult the recommended books to clarify your concepts as handouts are not sufficient.

You are supposed to submit your assignment in .doc or docx format.
Any other formats like scan images, PDF, zip, rar, ppt and bmp etc. will not be accepted.

Objective:
• The objective of this assignment is to provide understanding of:
Semaphore and Resource Allocation Graph

NOTE

No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.

If you find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.

For any query, feel free to email at:
[email protected]

Question No 01 8 Marks

Consider a banking transaction system where two processes Cash Withdrawal and Cash Deposit for a bank account could take place at the same time. The Cash Withdrawal process helps in withdrawing some cash amount using the ATM and the Cash Deposit process is used to deposit some amount into the account through a cheque. Which synchronization technique should be adopted in order to make sure that these processes can take place mutually exclusive? Write pseudo-code or algorithm for these two processes.

Note: No need to write code in any programing language.

Question No 02 12 Marks

Suppose a computer lab comprises of two printers, three scanners, and four ROM writers. There are three programs currently running on some computer. Assume program P1 is currently allocated a printer and two ROM writers and it is waiting for a scanner. Program P2 is allocated a scanner and it is waiting for a printer. Program P3 is allocated two ROM writers, a scanner, and a printer. Draw the corresponding resource allocation graph for these three programs. Also specify if the system is in a deadlocked state or not?

Wish you very Best of Luck!

CS604 - Operating Systems
3 Posts
0 Votes
CS604 Assignment 2 Solution and Discussion
zareenZ zareen

Operating Systems (CS604)
Assignment # 02
FALL 2019
Total marks = 20

Deadline Date
02.12.2019

Please carefully read the following instructions before attempting assignment.

RULES FOR MARKING
It should be clear that your assignment would not get any credit if:
 The assignment is submitted after the due date.
 The submitted assignment file does not open or it is corrupt.
 The submitted assignment solution is copied from any other student or from the internet.

You should consult the recommended books to clarify your concepts as handouts are not sufficient.

You are supposed to submit your assignment in .doc or docx format.
Any other formats like scan images, PDF, zip, rar, ppt and bmp etc will not be accepted.

Objective:
• The objective of this assignment is to provide hands on experience of:
Different Process Scheduling Algorithms in Operating System

NOTE

No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.

If you find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.

For any query, feel free to email at:
[email protected]

Question No 01 4+3+3=10 marks
Assume you have to apply Shortest Job First (SJF) scheduling algorithms on the set of different processes given in the table below. The CPU burst time is also given for each process. Consider that all the processes arrive in the ready queue within time 0 seconds except P2 that arrive in ready queue within time 8 seconds. You are required to show the Gantt Chart to illustrate the execution sequence of these processes and calculate the Total Waiting Time and Average Waiting Time for the given processes by using SJF algorithm.

Process CPU Burst Time (seconds)
P0 2
P1 6
P2 1
P3 4
P4 3
P5 8

Question No 02 4+3+3=10 marks
Consider a scenario where you have to apply Round Robin scheduling algorithm on the below given set of processes with each having a quantum size=8 milliseconds. The CPU burst time and arrival time for each process is also provided in the given table. You are required to show the Gantt Chart to illustrate the execution sequence of these processes. Moreover, calculate the Average Turnaround Time and Average Waiting Time for given processes by using round robin algorithm.

Process CPU Burst Time (Milliseconds) Arrival Time(Milliseconds)
P0 15 0
P1 8 4
P2 25 18
P3 18 5

Wish you very Best of Luck!

CS604 - Operating Systems
8 Posts
0 Votes
CS604 Assignment 1 Solution and Discussion
zareenZ zareen

Operating Systems (CS604)
Assignment # 01
Fall 2019
Total marks = 20

Deadline Date
16-11-2019

Please carefully read the following instructions before attempting assignment.

RULES FOR MARKING
It should be clear that your assignment would not get any credit if:
 The assignment is submitted after the due date.
 The submitted assignment does not open or file is corrupt.
 Strict action will be taken if submitted solution is copied from any other student or from the internet.

You should consult the recommended books to clarify your concepts as handouts are not sufficient.

You are supposed to submit your assignment in .doc or docx format.
Any other formats like scan images, PDF, zip, rar, ppt and bmp etc will not be accepted.

Objective:
• The objective of this assignment is to provide hands on experience of:
• To learn and understand the basic concept of an Operating System
• To learn Process and its states

NOTE

No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.

If you find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.

For any query, feel free to email at:
[email protected]

Question No 01 2*5=10 marks

As a process executes, it changes states. The state of a process is defined in part by the current activity of that process. Given below are current and next states of process. According to your understanding write process conditions based on the states in which process is currently in. what can be the condition that changes one state into another?

711993dd-d5ba-4dd9-b8e8-13ae4e0898e1-image.png

Question No 02 2*5=10 marks

The following table contains the list of operations. Write down the Linux commands along with their screenshots for performing these operations:
e6f1dbaf-ee88-4f30-8ad2-a08f1ca000e1-image.png
List of Operations
List the contents of files to the terminal window.
Change the owner and group owner of a file.
Compares two text files and show the differences between them
Print a string of text to the terminal window.
Change the password for a user.

You are required to run the respective commands on Ubuntu and provide relevant screen shots of the list of operations as stated in above table.

Wish you very Best of Luck!

CS604 - Operating Systems
5 Posts
0 Votes
CS604 GDB 1 solution and discussion
zaasmiZ zaasmi

Graded Discussion Board

Semester: Spring 2019
Operating System – CS604

Instructions:

Please read the following instructions carefully before submitting the GDB:

A concise, coherent and to the point comment is preferred over lengthy comment having irrelevant details. Your comment must not be more than 4-5 lines.
Comments, posted on regular Lesson’s MDB or sent through email will NOT be considered in any case. Any request about such an acceptance will not be catered.
You should post your answer on the Graded Discussion Board (GDB), not on the Moderated Discussion Board (MDB).
For any query about the GDB, contact at [email protected]
Topic: “Characteristics Based Comparison Of Operating Systems”

Scenario

Suppose an enterprise intends to decentralize its infrastructure. In this process of decentralization, the enterprise has to use mobile-based services at the employee/user end. The budget allocated for this transformation is very limited, so the enterprise has to select an operating system that is flexible enough to accommodate its services and cheaper as well. Select an operating system for mobile devices that is suitable for the organization’s needs and give justification for your selection.

Best of Luck !

CS604 - Operating Systems
3 Posts
0 Votes
CS604 Assignment # 03
 Solution and Discussion
zaasmiZ zaasmi

66aa4c6d-8d94-4d53-89e7-ab7904f822a1-image.png

Operating Systems (CS604)
Assignment # 03
Spring 2019

Total marks = 20

Deadline Date 
 23rd July, 2019

Please carefully read the following instructions before attempting assignment.

RULES FOR MARKING
It should be clear that your assignment would not get any credit if:
♣ The assignment is submitted after the due date.
♣ The submitted assignment does not open or file is corrupt.
♣ Strict action will be taken if submitted solution is copied from any other student or from the internet.

You should consult the recommended books to clarify your concepts as handouts are not sufficient.

You are supposed to submit your assignment in .doc or docx format.
Any other formats like scan images, PDF, zip, rar, ppt and bmp etc will not be accepted.

Objective:
• The objective of this assignment is to provide hands on experience of:
• To learn and understand deadlock algorithms in Operating System

NOTE

No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.

If you find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.

For any query, feel free to email at:
[email protected]

Question No 1 15 Marks
Consider the below given snapshot of the system. P1 to P5 represent the 5 processes currently running on the system. M, N, O and P represent the resources whereas M, N, O and P have 13, 11, 9 and 16 instances respectively.
81858d3b-c30e-4b21-93b8-bb96c3476b68-image.png

Considering the given snapshot, answer the following questions using the banker’s algorithm:
(a) What will be the content of the matrix Available? 5 Marks
(b) What will be the content of the matrix Need? 5 Marks
© Is the system in a safe state Yes/No? If yes, then identify the safe sequence. 5 Marks

Question No 2 5 Marks
Consider the following resource allocation graph. Is there any deadlock in this graph or not? If yes, then mention the dead lock sequence.

5f0c00bb-3c13-45e5-8c8b-aa638a964522-image.png

CS604 - Operating Systems
1 Posts
0 Votes
Operating Systems (CS604) Assignment # 02
 Spring 2019 Solution and Discussion
zaasmiZ zaasmi

3ee3e99a-4656-4cc7-9374-92e3f17cd522-image.png

Operating Systems (CS604)
Assignment # 02
Spring 2019

Total marks = 20

Deadline Date
3rd June 2019

Please carefully read the following instructions before attempting assignment.

RULES FOR MARKING
It should be clear that your assignment would not get any credit if:
♣ The assignment is submitted after the due date.
♣ The submitted assignment file does not open or it is corrupt.
♣ The submitted assignment solution is copied from any other student or from the internet.

You should consult the recommended books to clarify your concepts as handouts are not sufficient.

You are supposed to submit your assignment in .doc or docx format.
Any other formats like scan images, PDF, zip, rar, ppt and bmp etc will not be accepted.

Objective:
• The objective of this assignment is to provide hands on experience of:
Different Process Scheduling Algorithms in Operating System

NOTE

No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.

If you find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.

For any query, feel free to email at:
[email protected]

Question No 01 10 marks
Assume you have to apply First Come First Serve (FCFS) scheduling algorithms on the set of different processes given in the table below. The CPU burst time is also given for each process. Consider that all the processes arrive in the ready queue within time 0 seconds. You are required to show the Gantt chart to illustrate the execution sequence of these processes and calculate the total waiting time and average waiting time for the given processes by using FCFS algorithm.

[center]be925094-181f-4e06-8dca-f6059257d61c-image.png[/center]

Question No 02 10 marks
Consider a scenario where you have to apply Round Robin scheduling algorithm on the below given set of processes with each having a quantum size=10 milliseconds. The CPU burst time and arrival time for each process is also provided in the given table. You are required to show the Gantt chart to illustrate the execution sequence of these processes. Moreover, calculate the average turnaround time and average waiting time for given processes by using round robin algorithm.

[center]f390b50c-f3c3-4441-a4dc-3c15e71b2c18-image.png[/center]

Wish you very Best of Luck!

CS604 - Operating Systems
1 Posts
0 Votes
CS604 Quiz#1 Solution and discussion
M moaaz

___________ scheduler takes the process from the ready queue and assign the CPU with the help of Dispatcher.
Long term
Short term
Medium
Swapper

While using the read/write system call which data type is use to return the size of file to buffer from file descriptor fd? CS604
Pipefd
SIZE_MAX
FIFO
Ssize_t

_____ system call is used to write to a file or FIFO or any other IPC channel. CS604
read
write
open
fork

In multi-threaded process thread () take two argument, they are used to take______________ and ___________. CS604

Program counter value, address space limit
New thread ID, process name
Register count, program counter
New thread function name, new thread ID

The basic purpose of ________________is to help the users to utilize the hardware resources for completing different tasks in a simplified manner. CS604

Operating system (Page 6)
Application software
All Software
All of the given

When sender never block because it has an infinite length storage area, then it means it is holding a queue of _____________ capacity. CS604

Zero
Unbounded
Defined
Bounded

How many modes are supported in operating system? CS604

1
2
3
4

In process management, some of the jobs can be suspended for some time in order to give other jobs a chance to be in execution. Which command can be used to place back a suspended program? CS604
fg
top
ps
bg

A Process ‘A’ that has finished working but its parent process has also finished its execution. In this state the process ‘A’ will be called as _____ process. CS604

Child
Thread
Zombie (Page No. 39)
Fork
In Unix/Linux ------------- are used for client server communication to pass data between a server process and client processes. CS604
FIFO (page 60)
LIFO
Read()
Write()

CS604 - Operating Systems
1 Posts
0 Votes
Operating Systems (CS604) Assignment # 01
 Spring 2019
cyberianC cyberian

Spring 2019_CS604_1.docx

Operating Systems (CS604)
Assignment # 01
Spring 2019

Total marks = 20

Deadline Date 
14th May 2019

Please carefully read the following instructions before attempting assignment.

RULES FOR MARKING
It should be clear that your assignment would not get any credit if:
♣ The assignment is submitted after the due date.
♣ The submitted assignment does not open or file is corrupt.
♣ Strict action will be taken if submitted solution is copied from any other student or from the internet.

You should consult the recommended books to clarify your concepts as handouts are not sufficient.

You are supposed to submit your assignment in .doc or docx format.
Any other formats like scan images, PDF, zip, rar, ppt and bmp etc will not be accepted.

Objective:
• The objective of this assignment is to provide hands on experience of:
• To learn and understand the basic concept of an Operating System
• To learn Directory Structure of Operating System

NOTE

No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of deadline. It is recommended to upload solution file at least two days before its closing date.

If you find any mistake or confusion in assignment (Question statement), please consult with your instructor before the deadline. After the deadline no queries will be entertained in this regard.

For any query, feel free to email at:
[email protected]

Question No 01 10 marks

The following figure shows the directory structure in a UNIX/Linux system. Suppose, user Hassan has a subdirectory named courses under his home directory. This directory contains subdirectories for the courses that he has taken i.e. (CS401 and CS604).

If hassan is currently in the courses directory than write the UNIX/Linux commands to perform following operations.

  1. How he can navigate back to his home directory?
  2. How he can navigate to his personal directory?
  3. How he can navigate to the directory for cs604 course?
  4. Right after the login, how he can display names of files and directories in his home directory?
  5. How he can create a new directory named programs under cs604 directory?

Question No 02 10 marks

The following table contains the list of operations based on important directories in the Linux operating system; you are required to mention the directory names used in Linux operating system against each desired output operation.

Sr #
List of Operations
Directory
1
To contain the devices available to Linux

2
Used for mounting temporary file systems

3
To store system configuration files

4
For the storage of large applications packages

5
To store shared libraries and kernel modules

Wish you very Best of Luck!

CS604 - Operating Systems
2 Posts
1 Votes

McQ Solved for Mid Tearm and Final Term

Scheduled Pinned Locked Moved CS604 - Operating Systems
9 Posts 4 Posters 13.4k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moaaz
    Cyberian's Gold
    wrote on last edited by
    #1

    If a system is not in a safe state, there can be No deadlocks.
    ►True
    ►False(Page 137)
    A dashed line is used to represent a _________ in Resource Allocation Graph.
    ►Claim edge (Page 138)
    ►Request edge
    ►Assignment edge
    ►Allocation edge
    The process of holding at least one resource and waiting to acquire additional resources that are currently
    being held by other processes is known as________.
    ►Mutual exclusion
    ►Hold and wait (Page 131)
    ►No preemption
    ►Circular wait
    In Resource Allocation Graph, A _______ Pi →Rj indicates that process Pi may request resource Rj at some
    time in the future.
    ►Claim edge (Page 138)
    ►Request edge
    ►Assignment edge
    ►Allocation edge
    If the system can allocate resources to each process in some order and still avoid a deadlock then it said to
    be in ______ state.
    ►Safe (Page 137)
    ►Unsafe
    ►Mutual
    ►Starvation
    A condition where a set of blocked processes each holding a resource and waiting to acquire a resource
    held by another process in the set is termed as ________.
    ►Deadlock (Page 130)
    ►Starvation
    The following is NOT a classical problem of synchronization
    ►Bounded buffer problem
    ►Reader writer problem
    ►Dining philosopher‟s problem
    ►Counting semaphore problem (Page 118)
    (MCQZ-CS604 Operating Systems)
    (No repeated Questions) April 2014
    (MCS Students: MC120202589/MC120201756)
    Virtual University Of Pakistan
    [email protected], [email protected]
    The integer value of ________semaphores can range over an unrestricted integer domain.
    ►Counting (Page 117)
    ►Binary
    ►Mutex
    ►Bounded buffer
    The condition in which a set {P0, P1… Pn} of waiting processes must exist such that P0 is waiting for a
    resource that is held by P1, P1 is waiting for a resource that is held by P2, and so on, Pn-1 is waiting for a
    resource held by Pn, and Pn is waiting for a resource held by P0. This condition is known as
    ______________.
    ►Mutual exclusion
    ►Hold and wait
    ►No preemption
    ►Circular wait (Page 131)
    You can use the rm file1 command to __________ file1
    ►Retrieve
    ►Remove (Page 30)
    ►Make
    ►modify
    The correct command for compiling C program named program.c in Linux environment is
    ►gcc program.c -o FirstPrgram (Page 31)
    ►gcc -o FirstProgram program.c
    ►gcc -z FirstProgram program.c
    ►gcc program.c -m FirstPrgram
    Using _________system, we can create a new process in Linux.
    ►Fork (Page 39)
    ► exec
    ►wait
    ►exit
    Cooperating processes never share any data, code, memory or state.
    ►True
    ►False(Page 5)
    Question No: 5 of 10 ( Marks: 1 ) - Please choose one
    ____ command display the status of a process.
    ►ls
    ►ps (Page 66)
    ►gcc
    ►cat

    Swapper is also termed as Short term scheduler.
    ►True
    ►False(Page 36)
    _____ system call is used to write to a file or FIFO or any other IPC channel.
    ►read
    ►write(Page 48)
    ►open
    ►fork
    A Process „A‟ that has finished working but its parent process has also finished its execution. In this
    state the process „A‟ will be called as _____ process.
    ►Child
    ►Thread
    ►Zombie (Page 42)
    ►Fork
    _________________ scheduling allows a process to move between queues.
    ►Round Robin
    ►First Come First Serve
    ►Multilevel Feedback Queue (Page 92)
    ►Shortest Remaining Time First
    Kernel is responsible for scheduling the user level threads.
    ►True
    ►False (Page 73)
    A ---------------- (or an exception) is a software-generated interrupt caused either by an error (division by
    zero or invalid memory access) or by a user request for an operating system service.
    ► Interrupt
    ► Trap (Page 10)
    ► Signal
    ► Process
    Which register holds the smallest legal physical memory address for a process?
    ► Base register (Page 13)
    ► Limit register
    ► Status register
    ► None of the given options
    The --------------semaphore provides mutual exclusion for accesses to the buffer pool and is initialized to
    the value 1.
    ► mutex (Page 118)
    ► binary
    ► couting
    ► none of the given options
    Binary semaphores are those that have only two values---------
    ► 0 and n
    ► 0 and 0
    ► 0 and 1 (Page 117)
    ► None of the given options
    Physical memory is broken down into fixed-sized blocks, called----------- and Logical memory is divided
    into blocks of the same size, called -----------
    ► Frames, pages (Page 165)
    ► Pages, Frames
    ► Frames, holes
    ► Holes, segments
    A page table needed for keeping track of pages of the page table is called --------------
    ► 2-level paging
    ► Page directory (Page 173)
    ► Page size
    ► Page table size
    The address generated by the CPU, after any indexing or other addressing-mode arithmetic, is called a —
    -----address, and the address it gets translated to by the MMU is called a ---------address.
    ►Virtual, physical click here for detail
    ► Hexadecimal, Binary,
    ► Valid, invalid
    ► Physical, Virtual
    Each page is a power of -------- bytes long in paging scheme.
    ► 2
    ► 3
    ► 4 (Page 167)
    ► 5
    Which part of the computer system helps in managing the file and memory management system?
    ► Operating System (Page 5)
    ► Device Drivers
    ► Application Software
    ► Hardware
    Which of the following is correct definition for wait operation?
    ► wait(S) { (Page 111)

    while(S<=0)
    ;// no o
    S–;
    }
    ► wait(S) {
    S++;
    }
    ► wait(S) {
    while(S>=0)
    ;// no op
    S–;
    }
    ► wait(S) {
    S–;
    }
    In deadlock detection and recovery algorithm, a deadlock exists in the system if and only if the wait for
    graph contains a _____________
    ► Cycle (Page 147)
    ► Graph
    ► Edge
    ► Node
    ------------ register contains the size of the process
    ►Base register
    ►Index register
    ►Limit register (Page 13)
    ►Stack pointers register
    The -----------scheme is not applicable to a resource allocation system with multiple instances of each
    resource type.
    ►Wait for graph (Page 148)
    ►Resource allocation graph
    ►Both Resource-allocation and wait-for graph ► None of the given options
    ___________ algorithm is used in Deadlock avoidance.
    ►Bakery
    ►Banker‟s (Page 139)
    ►Mutual exclusion
    ►Safe Sequence
    What do we name to an address that is loaded into the memory-address register of the memory?
    ►Logical address
    ►Physical address (Page 155)
    ►Binary addresses
    ►None of the given options

    Cache is non-volatile memory.
    ►True
    ►False (Page 153)
    A system call________
    ►Is an entry point into the kernel code (Page 18)
    ►Allows a program to request a kernel service
    ►Is a technique to protect I/O devices and other system resources
    ►All of the these
    The condition where a set of blocked processes each holding a resource and waiting to acquire a resource
    held by another process in the set, is termed as ________.
    ►Deadlock (Page 130)
    ►Starvation
    Banker‟s algorithm is used for ________________
    ►Deadlock avoidance (Page 140)
    ►Deadlock detection
    ►Deadlock prevention
    ►Deadlock removal
    The ________ requires that once a writer is ready, that writer performs its write as soon as possible , if a
    writer waiting to access the object, no new readers may start reading.
    first readers-writers problem
    ►second readers-writers problem (Page 119)
    ►third readers-writers problem
    ►fourth readers-writers problem
    ________________ is an integer variable accessible through wait and signal which are atomic operations.
    ►Semaphore (Page 111)
    ►Mutex
    ►Busy w aiting
    ►Signal
    The integer value of _________ semaphores can not be greater than 1.
    ►Counting
    ►Binary (Page 117)
    ►Mutex
    ►Bounded buffer
    Starvation is infinite blocking caused due to unavailability of resources.
    ►True (Page 115)
    ►False

    Operating System provides services such as Managing Primary and Secondary Storage, Processes and
    Allowing user to manage his/her files and directories.
    ►True (Page 5)
    ►False
    ___________ is used in real time operating systems.
    ►Non-preemptive scheduling Click here for detail
    ►Preemptive scheduling
    ►Dispatching scheduling
    ►FCFS scheduling
    Preventing a condition of ________ to happen, deadlocks can be prevented to happen.
    ►Critical region
    ►Circular wait (Page 136)
    ►Monitors
    ►Critical section
    The problem with priority scheduling algorithm is ________.
     Deadlock
     Starvation (Page# 84)
     Aging
     Nice value
    Kernel threads are supported directly by the operating system. The kernel performs
    the scheduling, creation, and management in ------ command display the status of a
    process.
     ls
     ps (Page# 63)
     gcc
     cat
    _______________ scheduling algorithm can be preemptive or non-preemptive.
     First Come First Serve
     Shortest Job First (Page # 83)
     Round Robin
     Priority
    Round Robin algorithm is most suitable for __________.
     Time sharing system (Page # 86)
     Real time systems and batch systems
     Running Batch programs

     Expert system
    The critical section problem can‟t be solved by the following except
     Software based solution
     Firmware based solution (Page# 99)
     Operating system based solution
     Hardware based solution
    Mkfifo () is a _______.
     System Call
     Command
     Directory
     None of Above (Page# 57)
    Preemptive ----------------scheduling is sometimes called shortest remaining-time-first scheduling.
     First-Come-First-Served (FCFS)
     Round-Robin
     Sorted Job First (SJF) (Page# 83)
     Priority
    rm and rmkdir commands are used to _____________ directory.
     Create
     Move
     Remove(Page# 27)
     Modify
    Linux is only single user operating system
     True
     False (Page# 4)
    ____________ command is used to change the directory.
     Ls
     Cp
     Cd (Page# 23)
     mv
    ______________ is used to request the OS by the process to take an I/O or initiating child process.
    System call
    Interrupt
    Trap
    Signal

    A parent process calling __________ system call will be suspended until children process terminates.
    Select correct option:
    wait
    fork
    exit
    exec
    In producer-Consumer problem synchronization is required. On which shared area this
    synchronization actually affect?
     Counter
     Buffer (Page #45)
     Entry section
     Exit section
    Which could not be the advantage of thread?
     Separate address space
     Quick response
     Economical
     Best in multiprocessing environment
    Using hardware solution to synchronization for complex problems, introduce a new
    synchronization tool know as _______________.
     TestAndSet
     Semaphore (Page No. 111 )
     Swap
     Trap
    In instruction TestAndSet mutual exclusion implementation is done by declaring a Boolean
    variable lock ______________.
     Initialized as zero
     Initialized as true
     Initialized as 1
     Initialized as false (Page No. 109)
    Use of semaphore create a problem of busy waiting, this wastes CPU cycles that some other
    process may be able to use productively. This type of semaphore is also called ______________
     Semaphore S
     Spinlock (Page No. 112 )
     Locking Semaphore
     Mutex

    ------------- is a segment of code that accesses a shared resource like data structure or device
    that must not be concurrently accessed by more than one thread of execution.
     Multithreading
     Context switching
     Critical section (Page No. 105, click here for details )
     Pipelining
    Critical section is a place where certain shared structure is updated. Its solution required
    certain precaution; one of them is the access to critical section by one process at a time only.
    What this condition is termed as?
     Progress
     Entry section
     Bounded waiting
     Mutual exclusion
    A solution to the critical section problem must satisfy the following requirements except
     Progress
     Mutual Exclusion
     Bounded Waiting
     Race Condition
    Keep in mind scheduling algorithm, when you go to any famous fast food franchise .On
    entering the store, each customer receives a number. The customer with the lowest number is
    served next. This algorithm is called-------------.
     Dijkastra algorithm
     Simple algorithm
     Deadlock algorithm
     Bakery algorithm
    While executing the statement c++/c-- in Producer-Consumer problem, at back end certain
    number of instructions are executed, if interleaving of statements happen, it create race
    condition. Tell number of instructions that require “no interleaving” while executing c++/c–?
     3
     1
     2
     0
    User mode can run the Privileged instructions.
    Select correct option:
    True
    False

    In Unix/Linux environment, Ayesha wants to know the complete picture of current processes
    in her session. Which of the following command will help her in this regard?
    Select correct option:
    $ ps
    $ gcc
    $ top
    $ fifo
    When processes are generated using fork () system call and then after that they are
    coordinated with each other using IPC channel. They are utilizing a separate address space for
    each of process (parent, child), kernel resources and IPC channel. This makes it a more heavy.
    Which strategy can be used to make it light?
    Select correct option:
    Termination of child process when these become more
    Scheduling of each process
    Use of threads
    Use of Batch systems
    In process management, some of the jobs can be suspended for some time in order to give other
    jobs a chance to be in execution. Which command can be used to place back a suspended
    program?
    Select correct option:
    Fg
    Top
    Ps
    Bg
    When sender never block because it has an infinite length storage area, then it means it is
    holding a queue of _____________ capacity.
    Select correct option:
    Zero
    Unbounded
    Defined
    Bounded
    In system call that creates a pipe for IPC. If one of the operation from read/write would fail
    then what will be returned as result?
    Select correct option:
    -1,+1
    -1 (page 57)
    1
    0
    To terminate a process is pressed, which signal it actually pass to process for
    termination?
    Select correct option:
    SIGTERM
    SIGINT
    SIGKILL
    SIGTRAP
    A Process „A‟ that has finished working but its parent process has also finished its execution.
    In this state the process „A‟ will be called as _____ process.
    Select correct option:
    Child
    Thread
    Zombie
    Fork
    While using the read/write system call which data type is use to return the size of file to buffer
    from file descriptor fd?
    Select correct option:
    Pipefd
    SIZE_MAX
    FIFO
    Ssize_t (page45)
    In Unix/Linux ------------- are used for client server communication to pass data between a
    server process and client processes.
    Select correct option:
    FIFO (page 60)
    LIFO
    Read()
    Write()
    Consider a scenario of CPU protection, ----------- is added to the operating system in order to
    detect and avoid loop in a user program.
    Select correct option:
    I/O
    Timer
    Base and limit registers
    Turning interrupt enable off
    Thread that is not executed for servicing a request by a user thread .It is named as -------------.
    EINVAL
    EAGAIN
    LWP
    POSIX
    Consider three processes in scheduling. Here are the waiting times for three processes
    P1=4,P2=2,P3=6.Which one of is correct average waiting time per process?
    4 (page 81)
    6
    2
    3
    In Unix/Linux environment Ali want to know the number of processes running on the system and their
    status, number of CPUs in the system and their usage, amount of main memory and its usage. Which of
    the following command will help in this regard?
     $ ps
     $ gcc
     $ fifo
     $ top
    In multi-threaded process thread () take two argument, they are used to take______________
    and ___________.
     Program counter value, address space limit
     New thread ID, process name
     Register count, program counter
     New thread function name, new thread ID
    Pipes simply used on the command line to connect the standard input of one process to the
    standard input of another. Which of the following syntax is correct use of command line Linux
    /UNIX pipes?
    Select correct option:
    cmd1 % cmd2% ……… %cmdN
    cmd1 | cmd2 | … | cmdN (page 53)
    cmd1 $ cmd2 $ …………… $ cmdN
    cmd1 & cmd2 & ……………&cmdN
    __________ commands in Linux helps to create a new directory.
    Select correct option:
    ls
    cp
    mv
    mkdir
    When processes communicate with each other, they perform communication through
    synchronization and utilizing separate address spaces. This action is termed as


    Select correct option:
    Inter-process communication (page 67)
    Process management
    Synchronization
    Direct/indirect communication
    Ali is an operating system designer. One user requirement regarding OS is easy to debug and
    modify. In your opinion which one of the following OS structure Ali needs to follow?
    Select correct option:
    Simple OS Approach
    Micro kernels
    Layered Approach
    Virtual Machines
    Given bellow two statements can be categorized in some sort of message passing techniques.
    This type is named as ____________.
    • Send (A, message) • Receive (B, message)
    Synchronization
    Direct communication
    Explicit buffering
    Send by copy communication
    The TSL (TestAndSet instruction) which is the hardware solution to synchronization problem does
    not satisfy the ________ condition, hence not considered to be a good solution.
    Bounded waiting P/106
    None
    Mutual exclusion
    Progress
    The ------------system call is used to open or create a file.
    Open () Google
    Read ()
    Write ()

    Close ()
    ------------- Threads are implemented by a thread library.
    Kernel thread
    User thread pg 70
    In client-server applications, __________ are used to pass data between a server process and client
    processes.
    FIFOs
    Used by __________ commands o pass data from one shell pipeline to another, without creating
    temporary files.
    Shell
    Fork system call is zero for the __________ process.
    Child
    __________ that define the ways in which system resources are used to solve the computing
    problems of the users.
    Applications programs
    __________ is used to create a thread.
    Thread ()
    Which multi-threading models provides true concurrency __________ .
    One-to-one
    User level provided support for __________ .
    User threads
    In critical section problem each process must first request permission to enter its critical section,
    the section of code implementing this request is called the __________ .

    Entry section
    2-Process and n-Process solutions to the Critical Section Problem are software solutions.
    Software
    Command Name interpreter is often known as the _______.
    a. Register
    b. Shell
    c. Kernel
    d. Timer
    All jobs that enter into a ________system are kept in the job pool.
    a. Single user.
    b. Batch
    c. Multiprogrammed
    d. Time sharing system
    Using _____ system call, we can create a new process in Unix.
    a. Fork
    b. Exec
    c. Wait
    d. Exit
    Pipe system call is used to _________ a pipe.
    a. Destroy
    b. Create
    c. Modify
    d. Clear
    To avoid race condition, the number of processes that may be simultaneously inside the critical
    section is ___________.
    a. 8
    b. 1
    c. 16
    d. 0
    A time interval when a process uses CPU only is called ______________.

    a. Scheduling
    b. I/O burst
    c. CPU burst
    d. Dispatch latency
    The solution type where in critical section we use “entry section and “exit section” is called kind of
    _______________.
    Select correct option:
    Hardware Solution
    Assumption
    Software Solution
    Consider three processes in scheduling .Here are the waiting times for the three processes P1 = 5;
    P2 = 10; P3 = 3. Which one of the following is correct average waiting time per process?
    Select correct option:
    3
    2
    18
    6
    Critical section problem can be solved by using how many ways?
    Select correct option:
    4
    3 (page 101)
    1
    2
    The section of code before the critical section is called __________
    Select correct option:
    Entry section
    Remainder section
    Exit section
    Crystal section
    The section of code after the critical section is called __________.
    Select correct option:
    Crystal section
    Entry section
    Remainder section
    Exit section
    _____________ algorithm is used for solving n-process critical section problem.
    Select correct option:
    Bankers
    Bakery (page 105)
    Babbles
    None of the given
    Consider a system of N processes (Po, P1 …… Pn-1). Each process in its critical section and the
    process may be changing common variables, updating a table, writing a file etc. No other process is
    allowed to execute in its critical section. This problem is called -------------
    Select correct option:
    Bakery algorithm
    N-Mutual exclusion
    N-Process Critical Section (page 105)
    Deadlock algorithm
    Consider three processes in scheduling .Here are the waiting times for the three processes P1 = 4;
    P2 = 2; P3 = 6. Which one of the following is correct average waiting time per process?
    Select correct option:
    4
    6
    2
    3
    Clock interrupt handler is an example of kernel thread that is not executed for servicing by user
    thread. It is named as
    EInval
    EAGAIN
    LWP (I think)
    PoSIX

    Thanks for Sharing
    (MCQs- Solved- CS604 Operating Systems)
    (No repeated Questions) April 2014
    (MCS Students: MC120202589/MC120201756)
    Virtual University Of Pakistan
    [email protected], [email protected]

    Discussion is right way to get Solution of the every assignment, Quiz and GDB.
    We are always here to discuss and Guideline, Please Don't visit Cyberian only for Solution.
    Cyberian Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
    %(red)[NOTE: Don't copy or replicating idea solutions.]

    How to Get Earning from Cyberian

    Quiz Copy Solution
    Mid and Final Past Papers
    Live Chat

    For instructions on how to use this Cyberian discussion board

    cyberianC 2 Replies Last reply
    0
    • zaasmiZ Offline
      zaasmiZ Offline
      zaasmi
      Cyberian's Gold
      wrote on last edited by
      #2

      CS604 - Midterm Solved Mcqs with references by Moaaz.pdf

      CS604 - Midterm Solved Subjective with references by Moaaz.pdf

      Discussion is right way to get Solution of the every assignment, Quiz and GDB.
      We are always here to discuss and Guideline, Please Don't visit Community only for Solution.
      Community Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
      [NOTE: Don't copy or replicating idea solutions.]
      VU Handouts
      Quiz Copy Solution
      Mid and Final Past Papers
      Live Chat

      1 Reply Last reply
      0
      • zaasmiZ Offline
        zaasmiZ Offline
        zaasmi
        Cyberian's Gold
        wrote on last edited by
        #3

        CS604 Final Term Paper Solved By @moaaz
        CS604 - Finalterm Solved Mcqs Solved with references by Moaaz.pdf CS604 - Final term Solved Subjective with references by Moaaz.pdf CS604 - Finalterm Solved Mcqs Solved with references.doc CS604- FINAL TERM SUBJECTIVE WITH REFERENCE SOLVED BY UMAIR SAULAT.doc CS604 - Final term Solved Subjective with references.doc CS604 - Final term Solved Subjective with references - Short.doc

        Discussion is right way to get Solution of the every assignment, Quiz and GDB.
        We are always here to discuss and Guideline, Please Don't visit Community only for Solution.
        Community Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
        [NOTE: Don't copy or replicating idea solutions.]
        VU Handouts
        Quiz Copy Solution
        Mid and Final Past Papers
        Live Chat

        1 Reply Last reply
        0
        • zaasmiZ Offline
          zaasmiZ Offline
          zaasmi
          Cyberian's Gold
          wrote on last edited by
          #4

          What is the LRU?

          Discussion is right way to get Solution of the every assignment, Quiz and GDB.
          We are always here to discuss and Guideline, Please Don't visit Community only for Solution.
          Community Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
          [NOTE: Don't copy or replicating idea solutions.]
          VU Handouts
          Quiz Copy Solution
          Mid and Final Past Papers
          Live Chat

          zareenZ 1 Reply Last reply
          0
          • zaasmiZ zaasmi

            What is the LRU?

            zareenZ Offline
            zareenZ Offline
            zareen
            Cyberian's Gold
            wrote on last edited by
            #5

            @zaasmi

            1. A line replaceable unit, or LRU, is an equipment level repair.
            2. LRU is also short for least recently used, which is an Oracle algorithm that replaces the oldest data to make room for new data when out of memory.

            Discussion is right way to get Solution of the every assignment, Quiz and GDB.
            We are always here to discuss and Guideline, Please Don't visit Cyberian only for Solution.
            Cyberian Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
            %(red)[NOTE: Don't copy or replicating idea solutions.]
            Quiz Copy Solution
            Mid and Final Past Papers
            Live Chat

            1 Reply Last reply
            0
            • zareenZ Offline
              zareenZ Offline
              zareen
              Cyberian's Gold
              wrote on last edited by
              #6

              MULTICS?

              Discussion is right way to get Solution of the every assignment, Quiz and GDB.
              We are always here to discuss and Guideline, Please Don't visit Cyberian only for Solution.
              Cyberian Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
              %(red)[NOTE: Don't copy or replicating idea solutions.]
              Quiz Copy Solution
              Mid and Final Past Papers
              Live Chat

              zaasmiZ 1 Reply Last reply
              0
              • zareenZ zareen

                MULTICS?

                zaasmiZ Offline
                zaasmiZ Offline
                zaasmi
                Cyberian's Gold
                wrote on last edited by
                #7

                @zareen
                Multics (Multiplexed Information and Computing Service) is a timesharing operating system begun in 1965 and used until 2000. The system was started as a joint project by MIT’s Project MAC, Bell Telephone Laboratories, and General Electric Company’s Large Computer Products Division.Aug 7, 2019
                Multics History

                multicians.org

                Discussion is right way to get Solution of the every assignment, Quiz and GDB.
                We are always here to discuss and Guideline, Please Don't visit Community only for Solution.
                Community Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
                [NOTE: Don't copy or replicating idea solutions.]
                VU Handouts
                Quiz Copy Solution
                Mid and Final Past Papers
                Live Chat

                1 Reply Last reply
                0
                • M moaaz

                  If a system is not in a safe state, there can be No deadlocks.
                  ►True
                  ►False(Page 137)
                  A dashed line is used to represent a _________ in Resource Allocation Graph.
                  ►Claim edge (Page 138)
                  ►Request edge
                  ►Assignment edge
                  ►Allocation edge
                  The process of holding at least one resource and waiting to acquire additional resources that are currently
                  being held by other processes is known as________.
                  ►Mutual exclusion
                  ►Hold and wait (Page 131)
                  ►No preemption
                  ►Circular wait
                  In Resource Allocation Graph, A _______ Pi →Rj indicates that process Pi may request resource Rj at some
                  time in the future.
                  ►Claim edge (Page 138)
                  ►Request edge
                  ►Assignment edge
                  ►Allocation edge
                  If the system can allocate resources to each process in some order and still avoid a deadlock then it said to
                  be in ______ state.
                  ►Safe (Page 137)
                  ►Unsafe
                  ►Mutual
                  ►Starvation
                  A condition where a set of blocked processes each holding a resource and waiting to acquire a resource
                  held by another process in the set is termed as ________.
                  ►Deadlock (Page 130)
                  ►Starvation
                  The following is NOT a classical problem of synchronization
                  ►Bounded buffer problem
                  ►Reader writer problem
                  ►Dining philosopher‟s problem
                  ►Counting semaphore problem (Page 118)
                  (MCQZ-CS604 Operating Systems)
                  (No repeated Questions) April 2014
                  (MCS Students: MC120202589/MC120201756)
                  Virtual University Of Pakistan
                  [email protected], [email protected]
                  The integer value of ________semaphores can range over an unrestricted integer domain.
                  ►Counting (Page 117)
                  ►Binary
                  ►Mutex
                  ►Bounded buffer
                  The condition in which a set {P0, P1… Pn} of waiting processes must exist such that P0 is waiting for a
                  resource that is held by P1, P1 is waiting for a resource that is held by P2, and so on, Pn-1 is waiting for a
                  resource held by Pn, and Pn is waiting for a resource held by P0. This condition is known as
                  ______________.
                  ►Mutual exclusion
                  ►Hold and wait
                  ►No preemption
                  ►Circular wait (Page 131)
                  You can use the rm file1 command to __________ file1
                  ►Retrieve
                  ►Remove (Page 30)
                  ►Make
                  ►modify
                  The correct command for compiling C program named program.c in Linux environment is
                  ►gcc program.c -o FirstPrgram (Page 31)
                  ►gcc -o FirstProgram program.c
                  ►gcc -z FirstProgram program.c
                  ►gcc program.c -m FirstPrgram
                  Using _________system, we can create a new process in Linux.
                  ►Fork (Page 39)
                  ► exec
                  ►wait
                  ►exit
                  Cooperating processes never share any data, code, memory or state.
                  ►True
                  ►False(Page 5)
                  Question No: 5 of 10 ( Marks: 1 ) - Please choose one
                  ____ command display the status of a process.
                  ►ls
                  ►ps (Page 66)
                  ►gcc
                  ►cat

                  Swapper is also termed as Short term scheduler.
                  ►True
                  ►False(Page 36)
                  _____ system call is used to write to a file or FIFO or any other IPC channel.
                  ►read
                  ►write(Page 48)
                  ►open
                  ►fork
                  A Process „A‟ that has finished working but its parent process has also finished its execution. In this
                  state the process „A‟ will be called as _____ process.
                  ►Child
                  ►Thread
                  ►Zombie (Page 42)
                  ►Fork
                  _________________ scheduling allows a process to move between queues.
                  ►Round Robin
                  ►First Come First Serve
                  ►Multilevel Feedback Queue (Page 92)
                  ►Shortest Remaining Time First
                  Kernel is responsible for scheduling the user level threads.
                  ►True
                  ►False (Page 73)
                  A ---------------- (or an exception) is a software-generated interrupt caused either by an error (division by
                  zero or invalid memory access) or by a user request for an operating system service.
                  ► Interrupt
                  ► Trap (Page 10)
                  ► Signal
                  ► Process
                  Which register holds the smallest legal physical memory address for a process?
                  ► Base register (Page 13)
                  ► Limit register
                  ► Status register
                  ► None of the given options
                  The --------------semaphore provides mutual exclusion for accesses to the buffer pool and is initialized to
                  the value 1.
                  ► mutex (Page 118)
                  ► binary
                  ► couting
                  ► none of the given options
                  Binary semaphores are those that have only two values---------
                  ► 0 and n
                  ► 0 and 0
                  ► 0 and 1 (Page 117)
                  ► None of the given options
                  Physical memory is broken down into fixed-sized blocks, called----------- and Logical memory is divided
                  into blocks of the same size, called -----------
                  ► Frames, pages (Page 165)
                  ► Pages, Frames
                  ► Frames, holes
                  ► Holes, segments
                  A page table needed for keeping track of pages of the page table is called --------------
                  ► 2-level paging
                  ► Page directory (Page 173)
                  ► Page size
                  ► Page table size
                  The address generated by the CPU, after any indexing or other addressing-mode arithmetic, is called a —
                  -----address, and the address it gets translated to by the MMU is called a ---------address.
                  ►Virtual, physical click here for detail
                  ► Hexadecimal, Binary,
                  ► Valid, invalid
                  ► Physical, Virtual
                  Each page is a power of -------- bytes long in paging scheme.
                  ► 2
                  ► 3
                  ► 4 (Page 167)
                  ► 5
                  Which part of the computer system helps in managing the file and memory management system?
                  ► Operating System (Page 5)
                  ► Device Drivers
                  ► Application Software
                  ► Hardware
                  Which of the following is correct definition for wait operation?
                  ► wait(S) { (Page 111)

                  while(S<=0)
                  ;// no o
                  S–;
                  }
                  ► wait(S) {
                  S++;
                  }
                  ► wait(S) {
                  while(S>=0)
                  ;// no op
                  S–;
                  }
                  ► wait(S) {
                  S–;
                  }
                  In deadlock detection and recovery algorithm, a deadlock exists in the system if and only if the wait for
                  graph contains a _____________
                  ► Cycle (Page 147)
                  ► Graph
                  ► Edge
                  ► Node
                  ------------ register contains the size of the process
                  ►Base register
                  ►Index register
                  ►Limit register (Page 13)
                  ►Stack pointers register
                  The -----------scheme is not applicable to a resource allocation system with multiple instances of each
                  resource type.
                  ►Wait for graph (Page 148)
                  ►Resource allocation graph
                  ►Both Resource-allocation and wait-for graph ► None of the given options
                  ___________ algorithm is used in Deadlock avoidance.
                  ►Bakery
                  ►Banker‟s (Page 139)
                  ►Mutual exclusion
                  ►Safe Sequence
                  What do we name to an address that is loaded into the memory-address register of the memory?
                  ►Logical address
                  ►Physical address (Page 155)
                  ►Binary addresses
                  ►None of the given options

                  Cache is non-volatile memory.
                  ►True
                  ►False (Page 153)
                  A system call________
                  ►Is an entry point into the kernel code (Page 18)
                  ►Allows a program to request a kernel service
                  ►Is a technique to protect I/O devices and other system resources
                  ►All of the these
                  The condition where a set of blocked processes each holding a resource and waiting to acquire a resource
                  held by another process in the set, is termed as ________.
                  ►Deadlock (Page 130)
                  ►Starvation
                  Banker‟s algorithm is used for ________________
                  ►Deadlock avoidance (Page 140)
                  ►Deadlock detection
                  ►Deadlock prevention
                  ►Deadlock removal
                  The ________ requires that once a writer is ready, that writer performs its write as soon as possible , if a
                  writer waiting to access the object, no new readers may start reading.
                  first readers-writers problem
                  ►second readers-writers problem (Page 119)
                  ►third readers-writers problem
                  ►fourth readers-writers problem
                  ________________ is an integer variable accessible through wait and signal which are atomic operations.
                  ►Semaphore (Page 111)
                  ►Mutex
                  ►Busy w aiting
                  ►Signal
                  The integer value of _________ semaphores can not be greater than 1.
                  ►Counting
                  ►Binary (Page 117)
                  ►Mutex
                  ►Bounded buffer
                  Starvation is infinite blocking caused due to unavailability of resources.
                  ►True (Page 115)
                  ►False

                  Operating System provides services such as Managing Primary and Secondary Storage, Processes and
                  Allowing user to manage his/her files and directories.
                  ►True (Page 5)
                  ►False
                  ___________ is used in real time operating systems.
                  ►Non-preemptive scheduling Click here for detail
                  ►Preemptive scheduling
                  ►Dispatching scheduling
                  ►FCFS scheduling
                  Preventing a condition of ________ to happen, deadlocks can be prevented to happen.
                  ►Critical region
                  ►Circular wait (Page 136)
                  ►Monitors
                  ►Critical section
                  The problem with priority scheduling algorithm is ________.
                   Deadlock
                   Starvation (Page# 84)
                   Aging
                   Nice value
                  Kernel threads are supported directly by the operating system. The kernel performs
                  the scheduling, creation, and management in ------ command display the status of a
                  process.
                   ls
                   ps (Page# 63)
                   gcc
                   cat
                  _______________ scheduling algorithm can be preemptive or non-preemptive.
                   First Come First Serve
                   Shortest Job First (Page # 83)
                   Round Robin
                   Priority
                  Round Robin algorithm is most suitable for __________.
                   Time sharing system (Page # 86)
                   Real time systems and batch systems
                   Running Batch programs

                   Expert system
                  The critical section problem can‟t be solved by the following except
                   Software based solution
                   Firmware based solution (Page# 99)
                   Operating system based solution
                   Hardware based solution
                  Mkfifo () is a _______.
                   System Call
                   Command
                   Directory
                   None of Above (Page# 57)
                  Preemptive ----------------scheduling is sometimes called shortest remaining-time-first scheduling.
                   First-Come-First-Served (FCFS)
                   Round-Robin
                   Sorted Job First (SJF) (Page# 83)
                   Priority
                  rm and rmkdir commands are used to _____________ directory.
                   Create
                   Move
                   Remove(Page# 27)
                   Modify
                  Linux is only single user operating system
                   True
                   False (Page# 4)
                  ____________ command is used to change the directory.
                   Ls
                   Cp
                   Cd (Page# 23)
                   mv
                  ______________ is used to request the OS by the process to take an I/O or initiating child process.
                  System call
                  Interrupt
                  Trap
                  Signal

                  A parent process calling __________ system call will be suspended until children process terminates.
                  Select correct option:
                  wait
                  fork
                  exit
                  exec
                  In producer-Consumer problem synchronization is required. On which shared area this
                  synchronization actually affect?
                   Counter
                   Buffer (Page #45)
                   Entry section
                   Exit section
                  Which could not be the advantage of thread?
                   Separate address space
                   Quick response
                   Economical
                   Best in multiprocessing environment
                  Using hardware solution to synchronization for complex problems, introduce a new
                  synchronization tool know as _______________.
                   TestAndSet
                   Semaphore (Page No. 111 )
                   Swap
                   Trap
                  In instruction TestAndSet mutual exclusion implementation is done by declaring a Boolean
                  variable lock ______________.
                   Initialized as zero
                   Initialized as true
                   Initialized as 1
                   Initialized as false (Page No. 109)
                  Use of semaphore create a problem of busy waiting, this wastes CPU cycles that some other
                  process may be able to use productively. This type of semaphore is also called ______________
                   Semaphore S
                   Spinlock (Page No. 112 )
                   Locking Semaphore
                   Mutex

                  ------------- is a segment of code that accesses a shared resource like data structure or device
                  that must not be concurrently accessed by more than one thread of execution.
                   Multithreading
                   Context switching
                   Critical section (Page No. 105, click here for details )
                   Pipelining
                  Critical section is a place where certain shared structure is updated. Its solution required
                  certain precaution; one of them is the access to critical section by one process at a time only.
                  What this condition is termed as?
                   Progress
                   Entry section
                   Bounded waiting
                   Mutual exclusion
                  A solution to the critical section problem must satisfy the following requirements except
                   Progress
                   Mutual Exclusion
                   Bounded Waiting
                   Race Condition
                  Keep in mind scheduling algorithm, when you go to any famous fast food franchise .On
                  entering the store, each customer receives a number. The customer with the lowest number is
                  served next. This algorithm is called-------------.
                   Dijkastra algorithm
                   Simple algorithm
                   Deadlock algorithm
                   Bakery algorithm
                  While executing the statement c++/c-- in Producer-Consumer problem, at back end certain
                  number of instructions are executed, if interleaving of statements happen, it create race
                  condition. Tell number of instructions that require “no interleaving” while executing c++/c–?
                   3
                   1
                   2
                   0
                  User mode can run the Privileged instructions.
                  Select correct option:
                  True
                  False

                  In Unix/Linux environment, Ayesha wants to know the complete picture of current processes
                  in her session. Which of the following command will help her in this regard?
                  Select correct option:
                  $ ps
                  $ gcc
                  $ top
                  $ fifo
                  When processes are generated using fork () system call and then after that they are
                  coordinated with each other using IPC channel. They are utilizing a separate address space for
                  each of process (parent, child), kernel resources and IPC channel. This makes it a more heavy.
                  Which strategy can be used to make it light?
                  Select correct option:
                  Termination of child process when these become more
                  Scheduling of each process
                  Use of threads
                  Use of Batch systems
                  In process management, some of the jobs can be suspended for some time in order to give other
                  jobs a chance to be in execution. Which command can be used to place back a suspended
                  program?
                  Select correct option:
                  Fg
                  Top
                  Ps
                  Bg
                  When sender never block because it has an infinite length storage area, then it means it is
                  holding a queue of _____________ capacity.
                  Select correct option:
                  Zero
                  Unbounded
                  Defined
                  Bounded
                  In system call that creates a pipe for IPC. If one of the operation from read/write would fail
                  then what will be returned as result?
                  Select correct option:
                  -1,+1
                  -1 (page 57)
                  1
                  0
                  To terminate a process is pressed, which signal it actually pass to process for
                  termination?
                  Select correct option:
                  SIGTERM
                  SIGINT
                  SIGKILL
                  SIGTRAP
                  A Process „A‟ that has finished working but its parent process has also finished its execution.
                  In this state the process „A‟ will be called as _____ process.
                  Select correct option:
                  Child
                  Thread
                  Zombie
                  Fork
                  While using the read/write system call which data type is use to return the size of file to buffer
                  from file descriptor fd?
                  Select correct option:
                  Pipefd
                  SIZE_MAX
                  FIFO
                  Ssize_t (page45)
                  In Unix/Linux ------------- are used for client server communication to pass data between a
                  server process and client processes.
                  Select correct option:
                  FIFO (page 60)
                  LIFO
                  Read()
                  Write()
                  Consider a scenario of CPU protection, ----------- is added to the operating system in order to
                  detect and avoid loop in a user program.
                  Select correct option:
                  I/O
                  Timer
                  Base and limit registers
                  Turning interrupt enable off
                  Thread that is not executed for servicing a request by a user thread .It is named as -------------.
                  EINVAL
                  EAGAIN
                  LWP
                  POSIX
                  Consider three processes in scheduling. Here are the waiting times for three processes
                  P1=4,P2=2,P3=6.Which one of is correct average waiting time per process?
                  4 (page 81)
                  6
                  2
                  3
                  In Unix/Linux environment Ali want to know the number of processes running on the system and their
                  status, number of CPUs in the system and their usage, amount of main memory and its usage. Which of
                  the following command will help in this regard?
                   $ ps
                   $ gcc
                   $ fifo
                   $ top
                  In multi-threaded process thread () take two argument, they are used to take______________
                  and ___________.
                   Program counter value, address space limit
                   New thread ID, process name
                   Register count, program counter
                   New thread function name, new thread ID
                  Pipes simply used on the command line to connect the standard input of one process to the
                  standard input of another. Which of the following syntax is correct use of command line Linux
                  /UNIX pipes?
                  Select correct option:
                  cmd1 % cmd2% ……… %cmdN
                  cmd1 | cmd2 | … | cmdN (page 53)
                  cmd1 $ cmd2 $ …………… $ cmdN
                  cmd1 & cmd2 & ……………&cmdN
                  __________ commands in Linux helps to create a new directory.
                  Select correct option:
                  ls
                  cp
                  mv
                  mkdir
                  When processes communicate with each other, they perform communication through
                  synchronization and utilizing separate address spaces. This action is termed as


                  Select correct option:
                  Inter-process communication (page 67)
                  Process management
                  Synchronization
                  Direct/indirect communication
                  Ali is an operating system designer. One user requirement regarding OS is easy to debug and
                  modify. In your opinion which one of the following OS structure Ali needs to follow?
                  Select correct option:
                  Simple OS Approach
                  Micro kernels
                  Layered Approach
                  Virtual Machines
                  Given bellow two statements can be categorized in some sort of message passing techniques.
                  This type is named as ____________.
                  • Send (A, message) • Receive (B, message)
                  Synchronization
                  Direct communication
                  Explicit buffering
                  Send by copy communication
                  The TSL (TestAndSet instruction) which is the hardware solution to synchronization problem does
                  not satisfy the ________ condition, hence not considered to be a good solution.
                  Bounded waiting P/106
                  None
                  Mutual exclusion
                  Progress
                  The ------------system call is used to open or create a file.
                  Open () Google
                  Read ()
                  Write ()

                  Close ()
                  ------------- Threads are implemented by a thread library.
                  Kernel thread
                  User thread pg 70
                  In client-server applications, __________ are used to pass data between a server process and client
                  processes.
                  FIFOs
                  Used by __________ commands o pass data from one shell pipeline to another, without creating
                  temporary files.
                  Shell
                  Fork system call is zero for the __________ process.
                  Child
                  __________ that define the ways in which system resources are used to solve the computing
                  problems of the users.
                  Applications programs
                  __________ is used to create a thread.
                  Thread ()
                  Which multi-threading models provides true concurrency __________ .
                  One-to-one
                  User level provided support for __________ .
                  User threads
                  In critical section problem each process must first request permission to enter its critical section,
                  the section of code implementing this request is called the __________ .

                  Entry section
                  2-Process and n-Process solutions to the Critical Section Problem are software solutions.
                  Software
                  Command Name interpreter is often known as the _______.
                  a. Register
                  b. Shell
                  c. Kernel
                  d. Timer
                  All jobs that enter into a ________system are kept in the job pool.
                  a. Single user.
                  b. Batch
                  c. Multiprogrammed
                  d. Time sharing system
                  Using _____ system call, we can create a new process in Unix.
                  a. Fork
                  b. Exec
                  c. Wait
                  d. Exit
                  Pipe system call is used to _________ a pipe.
                  a. Destroy
                  b. Create
                  c. Modify
                  d. Clear
                  To avoid race condition, the number of processes that may be simultaneously inside the critical
                  section is ___________.
                  a. 8
                  b. 1
                  c. 16
                  d. 0
                  A time interval when a process uses CPU only is called ______________.

                  a. Scheduling
                  b. I/O burst
                  c. CPU burst
                  d. Dispatch latency
                  The solution type where in critical section we use “entry section and “exit section” is called kind of
                  _______________.
                  Select correct option:
                  Hardware Solution
                  Assumption
                  Software Solution
                  Consider three processes in scheduling .Here are the waiting times for the three processes P1 = 5;
                  P2 = 10; P3 = 3. Which one of the following is correct average waiting time per process?
                  Select correct option:
                  3
                  2
                  18
                  6
                  Critical section problem can be solved by using how many ways?
                  Select correct option:
                  4
                  3 (page 101)
                  1
                  2
                  The section of code before the critical section is called __________
                  Select correct option:
                  Entry section
                  Remainder section
                  Exit section
                  Crystal section
                  The section of code after the critical section is called __________.
                  Select correct option:
                  Crystal section
                  Entry section
                  Remainder section
                  Exit section
                  _____________ algorithm is used for solving n-process critical section problem.
                  Select correct option:
                  Bankers
                  Bakery (page 105)
                  Babbles
                  None of the given
                  Consider a system of N processes (Po, P1 …… Pn-1). Each process in its critical section and the
                  process may be changing common variables, updating a table, writing a file etc. No other process is
                  allowed to execute in its critical section. This problem is called -------------
                  Select correct option:
                  Bakery algorithm
                  N-Mutual exclusion
                  N-Process Critical Section (page 105)
                  Deadlock algorithm
                  Consider three processes in scheduling .Here are the waiting times for the three processes P1 = 4;
                  P2 = 2; P3 = 6. Which one of the following is correct average waiting time per process?
                  Select correct option:
                  4
                  6
                  2
                  3
                  Clock interrupt handler is an example of kernel thread that is not executed for servicing by user
                  thread. It is named as
                  EInval
                  EAGAIN
                  LWP (I think)
                  PoSIX

                  Thanks for Sharing
                  (MCQs- Solved- CS604 Operating Systems)
                  (No repeated Questions) April 2014
                  (MCS Students: MC120202589/MC120201756)
                  Virtual University Of Pakistan
                  [email protected], [email protected]

                  cyberianC Offline
                  cyberianC Offline
                  cyberian
                  Cyberian's Cyberian's Gold
                  wrote on last edited by
                  #8

                  @moaaz said in McQ Solved for Mid Tearm and Final Term:

                  In producer-Consumer problem synchronization is required. On which shared area this
                  synchronization actually affect?
                   Counter
                   Buffer (Page #45)
                   Entry section
                   Exit section

                  In the Producer-Consumer problem, synchronization is required to ensure that the shared resource (or shared area) is accessed safely by both the producer and the consumer. The synchronization actually affects the shared buffer.

                  Shared Buffer

                  • The shared buffer is a common area where the producer puts items and from where the consumer takes items.
                  • The buffer typically has a fixed size, meaning it can hold a limited number of items at any given time.

                  Synchronization Affects:

                  1. Buffer Access:

                    • Producer: Must wait if the buffer is full before adding new items.
                    • Consumer: Must wait if the buffer is empty before taking an item.
                  2. Mutual Exclusion:

                    • Ensures that only one of the producer or consumer accesses the buffer at a time, preventing race conditions.
                  3. Condition Variables/Flags:

                    • Often, condition variables (or flags) are used to signal when the buffer is full or empty, so the producer and consumer know when they can proceed.

                  Mechanisms Used:

                  • Locks/Mutexes: Ensure that only one thread (producer or consumer) can access the buffer at a time.
                  • Semaphores: Control the number of allowed accesses to the buffer, based on its current state (full, empty, etc.).
                  • Monitors: Provide a higher-level abstraction for managing mutual exclusion and synchronization.

                  By managing synchronization carefully on the shared buffer, the Producer-Consumer problem can be solved without causing data inconsistency or deadlock.

                  Discussion is right way to get Solution of the every assignment, Quiz and GDB.
                  We are always here to discuss and Guideline, Please Don't visit Community only for Solution.
                  Community Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
                  [NOTE: Don't copy or replicating idea solutions.]
                  Quiz Copy Solution
                  Mid and Final Past Papers
                  WhatsApp Channel
                  Mobile Tax Calculator

                  1 Reply Last reply
                  0
                  • M moaaz

                    If a system is not in a safe state, there can be No deadlocks.
                    ►True
                    ►False(Page 137)
                    A dashed line is used to represent a _________ in Resource Allocation Graph.
                    ►Claim edge (Page 138)
                    ►Request edge
                    ►Assignment edge
                    ►Allocation edge
                    The process of holding at least one resource and waiting to acquire additional resources that are currently
                    being held by other processes is known as________.
                    ►Mutual exclusion
                    ►Hold and wait (Page 131)
                    ►No preemption
                    ►Circular wait
                    In Resource Allocation Graph, A _______ Pi →Rj indicates that process Pi may request resource Rj at some
                    time in the future.
                    ►Claim edge (Page 138)
                    ►Request edge
                    ►Assignment edge
                    ►Allocation edge
                    If the system can allocate resources to each process in some order and still avoid a deadlock then it said to
                    be in ______ state.
                    ►Safe (Page 137)
                    ►Unsafe
                    ►Mutual
                    ►Starvation
                    A condition where a set of blocked processes each holding a resource and waiting to acquire a resource
                    held by another process in the set is termed as ________.
                    ►Deadlock (Page 130)
                    ►Starvation
                    The following is NOT a classical problem of synchronization
                    ►Bounded buffer problem
                    ►Reader writer problem
                    ►Dining philosopher‟s problem
                    ►Counting semaphore problem (Page 118)
                    (MCQZ-CS604 Operating Systems)
                    (No repeated Questions) April 2014
                    (MCS Students: MC120202589/MC120201756)
                    Virtual University Of Pakistan
                    [email protected], [email protected]
                    The integer value of ________semaphores can range over an unrestricted integer domain.
                    ►Counting (Page 117)
                    ►Binary
                    ►Mutex
                    ►Bounded buffer
                    The condition in which a set {P0, P1… Pn} of waiting processes must exist such that P0 is waiting for a
                    resource that is held by P1, P1 is waiting for a resource that is held by P2, and so on, Pn-1 is waiting for a
                    resource held by Pn, and Pn is waiting for a resource held by P0. This condition is known as
                    ______________.
                    ►Mutual exclusion
                    ►Hold and wait
                    ►No preemption
                    ►Circular wait (Page 131)
                    You can use the rm file1 command to __________ file1
                    ►Retrieve
                    ►Remove (Page 30)
                    ►Make
                    ►modify
                    The correct command for compiling C program named program.c in Linux environment is
                    ►gcc program.c -o FirstPrgram (Page 31)
                    ►gcc -o FirstProgram program.c
                    ►gcc -z FirstProgram program.c
                    ►gcc program.c -m FirstPrgram
                    Using _________system, we can create a new process in Linux.
                    ►Fork (Page 39)
                    ► exec
                    ►wait
                    ►exit
                    Cooperating processes never share any data, code, memory or state.
                    ►True
                    ►False(Page 5)
                    Question No: 5 of 10 ( Marks: 1 ) - Please choose one
                    ____ command display the status of a process.
                    ►ls
                    ►ps (Page 66)
                    ►gcc
                    ►cat

                    Swapper is also termed as Short term scheduler.
                    ►True
                    ►False(Page 36)
                    _____ system call is used to write to a file or FIFO or any other IPC channel.
                    ►read
                    ►write(Page 48)
                    ►open
                    ►fork
                    A Process „A‟ that has finished working but its parent process has also finished its execution. In this
                    state the process „A‟ will be called as _____ process.
                    ►Child
                    ►Thread
                    ►Zombie (Page 42)
                    ►Fork
                    _________________ scheduling allows a process to move between queues.
                    ►Round Robin
                    ►First Come First Serve
                    ►Multilevel Feedback Queue (Page 92)
                    ►Shortest Remaining Time First
                    Kernel is responsible for scheduling the user level threads.
                    ►True
                    ►False (Page 73)
                    A ---------------- (or an exception) is a software-generated interrupt caused either by an error (division by
                    zero or invalid memory access) or by a user request for an operating system service.
                    ► Interrupt
                    ► Trap (Page 10)
                    ► Signal
                    ► Process
                    Which register holds the smallest legal physical memory address for a process?
                    ► Base register (Page 13)
                    ► Limit register
                    ► Status register
                    ► None of the given options
                    The --------------semaphore provides mutual exclusion for accesses to the buffer pool and is initialized to
                    the value 1.
                    ► mutex (Page 118)
                    ► binary
                    ► couting
                    ► none of the given options
                    Binary semaphores are those that have only two values---------
                    ► 0 and n
                    ► 0 and 0
                    ► 0 and 1 (Page 117)
                    ► None of the given options
                    Physical memory is broken down into fixed-sized blocks, called----------- and Logical memory is divided
                    into blocks of the same size, called -----------
                    ► Frames, pages (Page 165)
                    ► Pages, Frames
                    ► Frames, holes
                    ► Holes, segments
                    A page table needed for keeping track of pages of the page table is called --------------
                    ► 2-level paging
                    ► Page directory (Page 173)
                    ► Page size
                    ► Page table size
                    The address generated by the CPU, after any indexing or other addressing-mode arithmetic, is called a —
                    -----address, and the address it gets translated to by the MMU is called a ---------address.
                    ►Virtual, physical click here for detail
                    ► Hexadecimal, Binary,
                    ► Valid, invalid
                    ► Physical, Virtual
                    Each page is a power of -------- bytes long in paging scheme.
                    ► 2
                    ► 3
                    ► 4 (Page 167)
                    ► 5
                    Which part of the computer system helps in managing the file and memory management system?
                    ► Operating System (Page 5)
                    ► Device Drivers
                    ► Application Software
                    ► Hardware
                    Which of the following is correct definition for wait operation?
                    ► wait(S) { (Page 111)

                    while(S<=0)
                    ;// no o
                    S–;
                    }
                    ► wait(S) {
                    S++;
                    }
                    ► wait(S) {
                    while(S>=0)
                    ;// no op
                    S–;
                    }
                    ► wait(S) {
                    S–;
                    }
                    In deadlock detection and recovery algorithm, a deadlock exists in the system if and only if the wait for
                    graph contains a _____________
                    ► Cycle (Page 147)
                    ► Graph
                    ► Edge
                    ► Node
                    ------------ register contains the size of the process
                    ►Base register
                    ►Index register
                    ►Limit register (Page 13)
                    ►Stack pointers register
                    The -----------scheme is not applicable to a resource allocation system with multiple instances of each
                    resource type.
                    ►Wait for graph (Page 148)
                    ►Resource allocation graph
                    ►Both Resource-allocation and wait-for graph ► None of the given options
                    ___________ algorithm is used in Deadlock avoidance.
                    ►Bakery
                    ►Banker‟s (Page 139)
                    ►Mutual exclusion
                    ►Safe Sequence
                    What do we name to an address that is loaded into the memory-address register of the memory?
                    ►Logical address
                    ►Physical address (Page 155)
                    ►Binary addresses
                    ►None of the given options

                    Cache is non-volatile memory.
                    ►True
                    ►False (Page 153)
                    A system call________
                    ►Is an entry point into the kernel code (Page 18)
                    ►Allows a program to request a kernel service
                    ►Is a technique to protect I/O devices and other system resources
                    ►All of the these
                    The condition where a set of blocked processes each holding a resource and waiting to acquire a resource
                    held by another process in the set, is termed as ________.
                    ►Deadlock (Page 130)
                    ►Starvation
                    Banker‟s algorithm is used for ________________
                    ►Deadlock avoidance (Page 140)
                    ►Deadlock detection
                    ►Deadlock prevention
                    ►Deadlock removal
                    The ________ requires that once a writer is ready, that writer performs its write as soon as possible , if a
                    writer waiting to access the object, no new readers may start reading.
                    first readers-writers problem
                    ►second readers-writers problem (Page 119)
                    ►third readers-writers problem
                    ►fourth readers-writers problem
                    ________________ is an integer variable accessible through wait and signal which are atomic operations.
                    ►Semaphore (Page 111)
                    ►Mutex
                    ►Busy w aiting
                    ►Signal
                    The integer value of _________ semaphores can not be greater than 1.
                    ►Counting
                    ►Binary (Page 117)
                    ►Mutex
                    ►Bounded buffer
                    Starvation is infinite blocking caused due to unavailability of resources.
                    ►True (Page 115)
                    ►False

                    Operating System provides services such as Managing Primary and Secondary Storage, Processes and
                    Allowing user to manage his/her files and directories.
                    ►True (Page 5)
                    ►False
                    ___________ is used in real time operating systems.
                    ►Non-preemptive scheduling Click here for detail
                    ►Preemptive scheduling
                    ►Dispatching scheduling
                    ►FCFS scheduling
                    Preventing a condition of ________ to happen, deadlocks can be prevented to happen.
                    ►Critical region
                    ►Circular wait (Page 136)
                    ►Monitors
                    ►Critical section
                    The problem with priority scheduling algorithm is ________.
                     Deadlock
                     Starvation (Page# 84)
                     Aging
                     Nice value
                    Kernel threads are supported directly by the operating system. The kernel performs
                    the scheduling, creation, and management in ------ command display the status of a
                    process.
                     ls
                     ps (Page# 63)
                     gcc
                     cat
                    _______________ scheduling algorithm can be preemptive or non-preemptive.
                     First Come First Serve
                     Shortest Job First (Page # 83)
                     Round Robin
                     Priority
                    Round Robin algorithm is most suitable for __________.
                     Time sharing system (Page # 86)
                     Real time systems and batch systems
                     Running Batch programs

                     Expert system
                    The critical section problem can‟t be solved by the following except
                     Software based solution
                     Firmware based solution (Page# 99)
                     Operating system based solution
                     Hardware based solution
                    Mkfifo () is a _______.
                     System Call
                     Command
                     Directory
                     None of Above (Page# 57)
                    Preemptive ----------------scheduling is sometimes called shortest remaining-time-first scheduling.
                     First-Come-First-Served (FCFS)
                     Round-Robin
                     Sorted Job First (SJF) (Page# 83)
                     Priority
                    rm and rmkdir commands are used to _____________ directory.
                     Create
                     Move
                     Remove(Page# 27)
                     Modify
                    Linux is only single user operating system
                     True
                     False (Page# 4)
                    ____________ command is used to change the directory.
                     Ls
                     Cp
                     Cd (Page# 23)
                     mv
                    ______________ is used to request the OS by the process to take an I/O or initiating child process.
                    System call
                    Interrupt
                    Trap
                    Signal

                    A parent process calling __________ system call will be suspended until children process terminates.
                    Select correct option:
                    wait
                    fork
                    exit
                    exec
                    In producer-Consumer problem synchronization is required. On which shared area this
                    synchronization actually affect?
                     Counter
                     Buffer (Page #45)
                     Entry section
                     Exit section
                    Which could not be the advantage of thread?
                     Separate address space
                     Quick response
                     Economical
                     Best in multiprocessing environment
                    Using hardware solution to synchronization for complex problems, introduce a new
                    synchronization tool know as _______________.
                     TestAndSet
                     Semaphore (Page No. 111 )
                     Swap
                     Trap
                    In instruction TestAndSet mutual exclusion implementation is done by declaring a Boolean
                    variable lock ______________.
                     Initialized as zero
                     Initialized as true
                     Initialized as 1
                     Initialized as false (Page No. 109)
                    Use of semaphore create a problem of busy waiting, this wastes CPU cycles that some other
                    process may be able to use productively. This type of semaphore is also called ______________
                     Semaphore S
                     Spinlock (Page No. 112 )
                     Locking Semaphore
                     Mutex

                    ------------- is a segment of code that accesses a shared resource like data structure or device
                    that must not be concurrently accessed by more than one thread of execution.
                     Multithreading
                     Context switching
                     Critical section (Page No. 105, click here for details )
                     Pipelining
                    Critical section is a place where certain shared structure is updated. Its solution required
                    certain precaution; one of them is the access to critical section by one process at a time only.
                    What this condition is termed as?
                     Progress
                     Entry section
                     Bounded waiting
                     Mutual exclusion
                    A solution to the critical section problem must satisfy the following requirements except
                     Progress
                     Mutual Exclusion
                     Bounded Waiting
                     Race Condition
                    Keep in mind scheduling algorithm, when you go to any famous fast food franchise .On
                    entering the store, each customer receives a number. The customer with the lowest number is
                    served next. This algorithm is called-------------.
                     Dijkastra algorithm
                     Simple algorithm
                     Deadlock algorithm
                     Bakery algorithm
                    While executing the statement c++/c-- in Producer-Consumer problem, at back end certain
                    number of instructions are executed, if interleaving of statements happen, it create race
                    condition. Tell number of instructions that require “no interleaving” while executing c++/c–?
                     3
                     1
                     2
                     0
                    User mode can run the Privileged instructions.
                    Select correct option:
                    True
                    False

                    In Unix/Linux environment, Ayesha wants to know the complete picture of current processes
                    in her session. Which of the following command will help her in this regard?
                    Select correct option:
                    $ ps
                    $ gcc
                    $ top
                    $ fifo
                    When processes are generated using fork () system call and then after that they are
                    coordinated with each other using IPC channel. They are utilizing a separate address space for
                    each of process (parent, child), kernel resources and IPC channel. This makes it a more heavy.
                    Which strategy can be used to make it light?
                    Select correct option:
                    Termination of child process when these become more
                    Scheduling of each process
                    Use of threads
                    Use of Batch systems
                    In process management, some of the jobs can be suspended for some time in order to give other
                    jobs a chance to be in execution. Which command can be used to place back a suspended
                    program?
                    Select correct option:
                    Fg
                    Top
                    Ps
                    Bg
                    When sender never block because it has an infinite length storage area, then it means it is
                    holding a queue of _____________ capacity.
                    Select correct option:
                    Zero
                    Unbounded
                    Defined
                    Bounded
                    In system call that creates a pipe for IPC. If one of the operation from read/write would fail
                    then what will be returned as result?
                    Select correct option:
                    -1,+1
                    -1 (page 57)
                    1
                    0
                    To terminate a process is pressed, which signal it actually pass to process for
                    termination?
                    Select correct option:
                    SIGTERM
                    SIGINT
                    SIGKILL
                    SIGTRAP
                    A Process „A‟ that has finished working but its parent process has also finished its execution.
                    In this state the process „A‟ will be called as _____ process.
                    Select correct option:
                    Child
                    Thread
                    Zombie
                    Fork
                    While using the read/write system call which data type is use to return the size of file to buffer
                    from file descriptor fd?
                    Select correct option:
                    Pipefd
                    SIZE_MAX
                    FIFO
                    Ssize_t (page45)
                    In Unix/Linux ------------- are used for client server communication to pass data between a
                    server process and client processes.
                    Select correct option:
                    FIFO (page 60)
                    LIFO
                    Read()
                    Write()
                    Consider a scenario of CPU protection, ----------- is added to the operating system in order to
                    detect and avoid loop in a user program.
                    Select correct option:
                    I/O
                    Timer
                    Base and limit registers
                    Turning interrupt enable off
                    Thread that is not executed for servicing a request by a user thread .It is named as -------------.
                    EINVAL
                    EAGAIN
                    LWP
                    POSIX
                    Consider three processes in scheduling. Here are the waiting times for three processes
                    P1=4,P2=2,P3=6.Which one of is correct average waiting time per process?
                    4 (page 81)
                    6
                    2
                    3
                    In Unix/Linux environment Ali want to know the number of processes running on the system and their
                    status, number of CPUs in the system and their usage, amount of main memory and its usage. Which of
                    the following command will help in this regard?
                     $ ps
                     $ gcc
                     $ fifo
                     $ top
                    In multi-threaded process thread () take two argument, they are used to take______________
                    and ___________.
                     Program counter value, address space limit
                     New thread ID, process name
                     Register count, program counter
                     New thread function name, new thread ID
                    Pipes simply used on the command line to connect the standard input of one process to the
                    standard input of another. Which of the following syntax is correct use of command line Linux
                    /UNIX pipes?
                    Select correct option:
                    cmd1 % cmd2% ……… %cmdN
                    cmd1 | cmd2 | … | cmdN (page 53)
                    cmd1 $ cmd2 $ …………… $ cmdN
                    cmd1 & cmd2 & ……………&cmdN
                    __________ commands in Linux helps to create a new directory.
                    Select correct option:
                    ls
                    cp
                    mv
                    mkdir
                    When processes communicate with each other, they perform communication through
                    synchronization and utilizing separate address spaces. This action is termed as


                    Select correct option:
                    Inter-process communication (page 67)
                    Process management
                    Synchronization
                    Direct/indirect communication
                    Ali is an operating system designer. One user requirement regarding OS is easy to debug and
                    modify. In your opinion which one of the following OS structure Ali needs to follow?
                    Select correct option:
                    Simple OS Approach
                    Micro kernels
                    Layered Approach
                    Virtual Machines
                    Given bellow two statements can be categorized in some sort of message passing techniques.
                    This type is named as ____________.
                    • Send (A, message) • Receive (B, message)
                    Synchronization
                    Direct communication
                    Explicit buffering
                    Send by copy communication
                    The TSL (TestAndSet instruction) which is the hardware solution to synchronization problem does
                    not satisfy the ________ condition, hence not considered to be a good solution.
                    Bounded waiting P/106
                    None
                    Mutual exclusion
                    Progress
                    The ------------system call is used to open or create a file.
                    Open () Google
                    Read ()
                    Write ()

                    Close ()
                    ------------- Threads are implemented by a thread library.
                    Kernel thread
                    User thread pg 70
                    In client-server applications, __________ are used to pass data between a server process and client
                    processes.
                    FIFOs
                    Used by __________ commands o pass data from one shell pipeline to another, without creating
                    temporary files.
                    Shell
                    Fork system call is zero for the __________ process.
                    Child
                    __________ that define the ways in which system resources are used to solve the computing
                    problems of the users.
                    Applications programs
                    __________ is used to create a thread.
                    Thread ()
                    Which multi-threading models provides true concurrency __________ .
                    One-to-one
                    User level provided support for __________ .
                    User threads
                    In critical section problem each process must first request permission to enter its critical section,
                    the section of code implementing this request is called the __________ .

                    Entry section
                    2-Process and n-Process solutions to the Critical Section Problem are software solutions.
                    Software
                    Command Name interpreter is often known as the _______.
                    a. Register
                    b. Shell
                    c. Kernel
                    d. Timer
                    All jobs that enter into a ________system are kept in the job pool.
                    a. Single user.
                    b. Batch
                    c. Multiprogrammed
                    d. Time sharing system
                    Using _____ system call, we can create a new process in Unix.
                    a. Fork
                    b. Exec
                    c. Wait
                    d. Exit
                    Pipe system call is used to _________ a pipe.
                    a. Destroy
                    b. Create
                    c. Modify
                    d. Clear
                    To avoid race condition, the number of processes that may be simultaneously inside the critical
                    section is ___________.
                    a. 8
                    b. 1
                    c. 16
                    d. 0
                    A time interval when a process uses CPU only is called ______________.

                    a. Scheduling
                    b. I/O burst
                    c. CPU burst
                    d. Dispatch latency
                    The solution type where in critical section we use “entry section and “exit section” is called kind of
                    _______________.
                    Select correct option:
                    Hardware Solution
                    Assumption
                    Software Solution
                    Consider three processes in scheduling .Here are the waiting times for the three processes P1 = 5;
                    P2 = 10; P3 = 3. Which one of the following is correct average waiting time per process?
                    Select correct option:
                    3
                    2
                    18
                    6
                    Critical section problem can be solved by using how many ways?
                    Select correct option:
                    4
                    3 (page 101)
                    1
                    2
                    The section of code before the critical section is called __________
                    Select correct option:
                    Entry section
                    Remainder section
                    Exit section
                    Crystal section
                    The section of code after the critical section is called __________.
                    Select correct option:
                    Crystal section
                    Entry section
                    Remainder section
                    Exit section
                    _____________ algorithm is used for solving n-process critical section problem.
                    Select correct option:
                    Bankers
                    Bakery (page 105)
                    Babbles
                    None of the given
                    Consider a system of N processes (Po, P1 …… Pn-1). Each process in its critical section and the
                    process may be changing common variables, updating a table, writing a file etc. No other process is
                    allowed to execute in its critical section. This problem is called -------------
                    Select correct option:
                    Bakery algorithm
                    N-Mutual exclusion
                    N-Process Critical Section (page 105)
                    Deadlock algorithm
                    Consider three processes in scheduling .Here are the waiting times for the three processes P1 = 4;
                    P2 = 2; P3 = 6. Which one of the following is correct average waiting time per process?
                    Select correct option:
                    4
                    6
                    2
                    3
                    Clock interrupt handler is an example of kernel thread that is not executed for servicing by user
                    thread. It is named as
                    EInval
                    EAGAIN
                    LWP (I think)
                    PoSIX

                    Thanks for Sharing
                    (MCQs- Solved- CS604 Operating Systems)
                    (No repeated Questions) April 2014
                    (MCS Students: MC120202589/MC120201756)
                    Virtual University Of Pakistan
                    [email protected], [email protected]

                    cyberianC Offline
                    cyberianC Offline
                    cyberian
                    Cyberian's Cyberian's Gold
                    wrote on last edited by
                    #9

                    @moaaz said in McQ Solved for Mid Tearm and Final Term:

                    The condition in which a set {P0, P1… Pn} of waiting processes must exist such that P0 is waiting for a
                    resource that is held by P1, P1 is waiting for a resource that is held by P2, and so on, Pn-1 is waiting for a
                    resource held by Pn, and Pn is waiting for a resource held by P0. This condition is known as
                    ______________.
                    ►Mutual exclusion
                    ►Hold and wait
                    ►No preemption
                    ►Circular wait (Page 131)

                    The condition described is known as a “deadlock.”

                    In the context of computer science and operating systems, a deadlock occurs when a set of processes are each waiting for a resource that another process in the set holds, creating a cycle of dependencies. Specifically, in the scenario you described:

                    • Process ( p_0 ) is waiting for a resource held by ( p_1 ),
                    • Process ( p_1 ) is waiting for a resource held by ( p_2 ),
                    • and so on, until
                    • Process ( p_n ) is waiting for a resource held by ( p_0 ).

                    This creates a circular wait, which is one of the necessary conditions for a deadlock to occur. In a deadlock situation, none of the processes can proceed because each is waiting for a resource held by another process in the cycle.

                    Discussion is right way to get Solution of the every assignment, Quiz and GDB.
                    We are always here to discuss and Guideline, Please Don't visit Community only for Solution.
                    Community Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
                    [NOTE: Don't copy or replicating idea solutions.]
                    Quiz Copy Solution
                    Mid and Final Past Papers
                    WhatsApp Channel
                    Mobile Tax Calculator

                    1 Reply Last reply
                    0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    Reputation Earning
                    How to Build a $1,000/Month World CUP LIVE Matches Live Cricket Streaming
                    Sponsored
                    File Sharing
                    Earn with File Sharing
                    Stats

                    1

                    Online

                    3.1k

                    Users

                    2.8k

                    Topics

                    8.6k

                    Posts
                    Popular Tags
                    solution
                    1235
                    discussion
                    1195
                    fall 2019
                    813
                    assignment 1
                    428
                    assignment 2
                    294
                    spring 2020
                    265
                    gdb 1
                    238
                    assignment 3
                    79
                    Trending
                    • PM. IMRAN KHAN
                      Zaeem ChZ
                      Zaeem Ch
                      4
                      3
                      5.0k

                    • Are the vaccines halal or not?
                      4
                      1
                      4.3k

                    • All Subjects MidTerm and Final Term Solved Paper Links Attached Please check moaaz past papers
                      zaasmiZ
                      zaasmi
                      3
                      26
                      80.9k

                    • CS614 GDB Solution and Discussion
                      M
                      moaaz
                      3
                      3
                      8.8k

                    • How can I receive Reputation earning from Cyberian? 100% Discount on Fee
                      Y
                      ygytyh
                      3
                      28
                      27.6k

                    Online User
                    | |
                    Copyright © 2010-26 RUP Technologies LLC. USA | Contributors | Privacy | Terms
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Pro Blog
                    • Users
                    • Groups
                    • Unsolved
                    • Solved