Oomp Unit 4 Mcqs
Oomp Unit 4 Mcqs
2) In _______ model the computer programs are set up in almost story form
(B) Communicating between two or more task that are executing in parallel
(C) Decomposing software into instructions or set of task that are executed simultaneously
6) In the following software development methodology there is interaction with the client at each phase
(A) Waterfall
(B) Structured
7) In the following software development methodology Each phase must be completed entirely before
entering to the next phase
(A) Waterfall
(B) Structured
8) In the following software development methodology top down approach to software development is
adopted
(A) Waterfall
(B) Structured
(A) Waterfall
(B) Structured
10) The hardware mechanism that enables a device to notify the CPU is called______________
(A) Polling
(C) Interrupt
(A) C++
(B) Eiffel
(A) allows processes to communicate and synchronize their action using same address space
(B) allows processes to communicate and synchronize their actions using the separate address space
(B) Mails
(C) Messages
(A) Seamaphore
(C) Socket
(A) the resource that can be used by one process at a time and is not depleted by that use
(C) the resource that can be used by more than one process at a time
23) the resource that can be used by more than one process at a time
(B) Deadlock
(B) when two or more tasks are attempting to update the same data source at the same time
(C) one resource is used by two or more process immediately one after the other
(B) when all the processes are trying to kill each other
32) The synchronization relationship in which task A can not be start until task B called ______________.
34) The synchronization relationnship in which task Acan not start until Task B finishes is called ________.
35) The synchronization relationnship in which task Acan finish until Task B finishes is called ________.
36) The behavioral modeling of multiprocessing componants can be repreented by following UML
diagram.
(A) the set of programs that allows the programmer to write his source code.
(D) the set of program that help in finding the error inan application program.
40) During the interaction of developers with operating system, the actual operating calls and IPC are at
___________ .
(A) level 1
(B) level 2
(C) level 3
(D) level 4
41) During the interaction of developers with operating system,the application framework for parallel
programming is at ___________________.
(A) level 1
(B) level 2
(C) level 3
(D) level 4
42) During the interaction of developers with operating system, the class libraries and OO components
for multiprocessing are at _____________.
(A) level 1
(B) level 2
(C) level 3
(D) level 4
43) During the interaction of developers with operating system, the posix spawn and thread
functionalities at ______________ .
(A) level 1
(B) level 2
(C) level 3
(D) level 4
46) Standard set of functions through which interacts with kernel is defined by __________ .
(B) compiler
(A) process
(B) thread
(A) posix_spawn()
(B) posix_create()
(C) create_process()
(D) new()
49) For controlling each process _____________ .
(A) posix_spawn()
(B) pthread_create()
(C) create()
52) Correct instrucion for exiction of the threaded test.cpp program is ______________.
(A) Abstraction
(C) Inheritance
(D) Polymorphism
(B) if used along with posix ,then cross platform components can be built
(C) can be used to add own building blocks to hogh level libraries
(A) fork-exec()
(B) new
(C) create
62) If a child process is created using posix_spawn() then child inherits__________from parent process.
66) The processes that perform housekeeping tasks such as allocating memory,checking device and so
on are called_________.
(C) stack
(D) queue
74) The information such as content of user,control and status register, stack pointers is stored
in_______section of PCB.
(B) capacity
(C) execution
(D) throughout
78) The number of processes completed per unit time is known as _______________________ .
(A) output
(B) capacity
(C) execution
(D) throughout
79) The child process completes execution but the parent keeps executing,then the child process is in
following state ________________.
(A) dead
(B) orphan
(C) zombie
(D) running
(C) inode
84) The state of the process after which it encounters wait on event or I/O is __________________.
(A) running
(B) ready
(C) sleeping
(D) stopped
85) Switching the CPU to another process requires to save state of the old process and loading new
process state is called as ______________ .
(C) dispatcher
(D) interrupt
87) In UNIX,following is an utility command for displaying the currently executing processes
___________.
(A) ls
(B) ps
(C) nice
(D) man
(C) process makes an I/o request or process switches from user mode to kernel mode
(A) PCB
91) A parent process calling------system call will be suspended until children processes terminate.
(A) fork
(B) wait
(C) exec
(D) exit
92) Which of the following system call does not return control to the calling point,on termination?
(A) fork
(B) exec
(A) fork
(B) exec
(C) ioctl
(A) fork
(B) exec
(C) ioctl
95) Which function establishes the connection between a process and a message queue with a message
queue descriptor?
(A) mq _open()
(B) mq _close()
(C) mq _send()
(D) mq _receive()
96) Which function removes the association between the message queue descriptor and its message
queue?
(A) mq _open()
(B) mq _close()
(C) mq _send()
(D) mq _receive()
97) Which function adds the message pointed to the message queue specified?
(A) mq _open()
(B) mq _close()
(C) mq _send()
(D) mq _receive()
98) Which function receives the oldest of the highest priority message(s) from the message queue
specified? (A) mq _open()
(B) mq _close()
(C) mq _send()
(D) mq _receive()
99) Which function registers the calling process to be notified of a message arriving at an empty
message queue that is associated with the specified message queue descriptor?
(A) mq _open()
(B) mq _close()
(C) mq _send()
(D) mq _receive()
100) Which function obtains the status information and attributes of the message queue and the open
message queue description associated with the message queue descriptor?
(A) mq _open()
(B) mq _close()
(C) mq _send()
(D) mq _receive()
101) Which function sets the status information and attributes of the message queue?
(A) mq _open()
(B) mq _close()
(C) mq _send()
(D) mq _receive()
overflow:auto;width:auto;color:black;background:white;bord
<stdio.h></span>
<stdlib.h></span>
#00aaaa">void</span> *ptr );
main()
pthread_t thread1;
#aa5500">"Thread-1"</span>;
style="color: #00aaaa">NULL</span>,
#00aaaa">NULL</span>);
#00aaaa">void</span> *ptr )
*) ptr;
"</span>, message);
</pre></div>
(A) Thread-2
(B) Thread-1
(C) Error
(D) None
103) WBS typically reflects _______ decomposition while AA reflects ________ decomposition.
104) Which of the following is the POSIX mechanism used for inter-process communication?
(C) pipes
105) Among the following which is the real challenge of IPC mechanism?
(A) Among the following which is the real challenge of IPC mechanism?
107) For establishing the connection between a process and a message queue,following function is used
____________ .
(A) mq_notify()
(B) mq_open()
(C) mq_create()
(D) mq_start()
108) For obtaning the status information and attributes of message queue, following function is used
__________ .
(A) mq_notify()
(B) mq_setattr()
(C) mq_getattr()
(D) mq_receive()
109) _________________ operating system API is used to associate software task with thread.
(A) create_thread()
(B) attach_thread()
(C) pthread_create()
(A) SCHED_FIFO
(B) SCHED_RR
(C) SCHED_SPORADIC
(A) 0
(B) -1
(C) 1
(D) -2
113) The information such as current state, priority of process,pointers to parent/child PCB is stored in
_________ section of PCB.
(A) 1,2,3
(B) 2,3,4
(C) 1,2,4
(A) FIFO
(D) SJF
119) With ___________________ more than one process can be running simultaneously each on a
different processor whereas with ________________ only one process can execute at a time.
120) Using ps utility for full listing of the processes following command is issued _____________.
(A) ls -f
(B) ls -full
(C) ls -j
(D) ls -o
121) The return value for the fork system call is------for child process and------for parent process.
<!-- HTML generated at Sahil's Blog sahilp.in using hilit.me --><div style="background: #ffffff;
overflow:auto;width:auto;color:black;background:white;border:solid gray;border-width:.1em .1em
.1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color:
#008080">#include<iostream></span>
fork();
cout<<endl;
</pre></div>
(A) deadlock
(A) SISD
(B) SIMD
(C) MISD
125) In the following snippet, the statement containing 'printf()' is executed _________ number of
times.
<!-- HTML generated at Sahil's Blog sahilp.in using hilit.me --><div style="background: #ffffff;
overflow:auto;width:auto;color:black;background:white;border:solid gray;border-width:.1em .1em
.1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%">fork();
fork();
</pre></div>
(A) 2
(B) 6
(C) 4
(D) 8
126) On executing the following statement in an unprivileged mode, the kill() function returns
___________.
<!-- HTML generated at Sahil's Blog sahilp.in using hilit.me --><div style="background: #ffffff;
overflow:auto;width:auto;color:black;background:white;border:solid gray;border-width:.1em .1em
.1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color:
#000080; font-weight: bold">int</span> ret=kill(<span style="color: #0000FF">1</span>,<span
style="color: #0000FF">5</span>);
</pre></div>
(A) -1
(B) 0
(C) 1
127) Suppose a process makes call to getppid() function and the function returns the value '3798' , then
this number indicates
(A) Memory management manages memory allocation for processes, which includes how memory is
allocated to a process and what to do when memory is fully utilized.
(C) Memory management manages the behavior and resources of a process.This includes process
execution, resource allocation and protection, and synchronization.
(D) None
129) Which one of the following challenges relate specifically to the operating system services?
(A) Software decomposition into instructions or sets of tasks that need to execute simultaneously
(B) Communication between two or more tasks that are executing in parallel
130) C++ developer using any of today’s modern operating systems has which basic choices for
implementing the tasks.
(A) Processes
(B) Threads
(C) Both
(D) None
131) Which one of the following is true regarding the POSIX Message Queue Functions
i)mq _send(): Establishes the connection between a process and a message queue with a
ii)mq _notify(): Registers the calling process to be notified of a message arriving at an empty
message queue that is associated with the specified message queue descriptor
iii)mq _setattr(): Sets the status information and attributes of the message queue
(A) i,ii
(B) i,iii
(C) only i
(D) ii,iii
132) Which of the following statement describes characteristics of pthread_create()
(C) It falls under the process management duties of the operating system
133) Match the following in therms (a,b,c,d) of POSIX Scheduling Policies with i,ii,iii,iv
a) SCHED_FIFO
b) SCHED_RR
c) SCHED_SPORADIC
d) SCHED_OTHER
i)When the quantum expires, the thread is placed at the head of the queue of its priority level.
ii)When the quantum expires, the thread is placed at the end of the queue of its priority level.
iv)Implementation defined; the most effective scheduling policy for general use.
(A) a-i,b-iii,c-iv,d-ii
(B) a-i,b-ii,c-iii,d-iv
(C) a-ii,b-iii,c-iv,d-i
(D) None
134) Which one of the following challenges relate specifically to the operating system services?
ii)Controlling resource contention when there is a many - to - one ratio between tasks and resource
multithreading
(A) i,ii
(B) iii,iv
(C) i,ii,iii
iii)We can pass the task that we want to associate with an operating system process to posix_spawn().
(A) i,iii
(B) i,ii
(C) ii,iii
(D) i,ii,iii
136) Which one of the following challenges relate specifically to the operating system services?
(A) Creating a test environment that simulates the parallel processing requirements and conditions
(C) Involving the operating system and compiler interface components of multithreading and
multiprocessing
i)Any task associated to a process through posix_spawn() can be scheduled by the operating system to
run in parallel with other processes.
(A) i,ii
(B) only i
(C) only ii
(D) None
overflow:auto;width:auto;color:black;background:white;bord
<stdio.h></span>
<stdlib.h></span>
<pthread.h></span>
#00aaaa">void</span> *ptr );
main()
{
pthread_t thread1, thread2;
iret2;
style="color: #00aaaa">NULL</span>,
#00aaaa">void</span>*) message1);
style="color: #00aaaa">NULL</span>,
#00aaaa">void</span>*) message2);
#00aaaa">NULL</span>);
#00aaaa">NULL</span>);
returns: %d\t"</span>,iret1);
returns: %d\t"</span>,iret2);
}
<span style="color: #00aaaa">void</span>
#00aaaa">void</span> *ptr )
*) ptr;
\n"</span>, message);
</pre></div>
hilit.me -->
(D) None
139) What is the output of the following code?
overflow:auto;width:auto;color:black;background:white;bord
<stdio.h></span>
<stdlib.h></span>
<pthread.h></span>
#00aaaa">void</span> *ptr );
main()
iret2;
iret1 = pthread_create( &thread1, <span
style="color: #00aaaa">NULL</span>,
#00aaaa">void</span>*) message1);
style="color: #00aaaa">NULL</span>,
#00aaaa">void</span>*) message2);
#00aaaa">NULL</span>);
#00aaaa">NULL</span>);
returns: %d\t"</span>,iret1);
#00aaaa">void</span> *ptr )
*) ptr;
</pre></div>
hilit.me -->
overflow:auto;width:auto;color:black;background:white;bord
<stdio.h></span>
<stdlib.h></span>
<pthread.h></span>
#00aaaa">void</span> *ptr );
main()
iret2;
style="color: #00aaaa">NULL</span>,
#00aaaa">void</span>*) message1);
style="color: #00aaaa">NULL</span>,
#00aaaa">void</span>*) message2);
#00aaaa">NULL</span>);
#00aaaa">NULL</span>);
*) ptr;
"</span>, message);
</pre></div>
hilit.me -->
(C) It depends
(D) None
141) What is the output of the following code?
overflow:auto;width:auto;color:black;background:white;bord
<stdio.h></span>
<stdlib.h></span>
<pthread.h></span>
#00aaaa">void</span> *ptr );
main()
#aa5500">"Thread-1"</span>;
iret2;
#00aaaa">void</span>*) message1);
style="color: #00aaaa">NULL</span>,
#00aaaa">void</span>*) message2);
#00aaaa">NULL</span>);
#00aaaa">NULL</span>);
#00aaaa">void</span> *ptr )
*) ptr;
"</span>, message);
</pre></div>
(C) Error
(D) None
overflow:auto;width:auto;color:black;background:white;bord
<stdio.h></span>
<stdlib.h></span>
<pthread.h></span>
#00aaaa">void</span> *ptr );
main()
pthread_t thread1;
#aa5500">"Thread-1"</span>;
style="color: #00aaaa">NULL</span>,
#00aaaa">void</span>*) message1);
#00aaaa">NULL</span>);
#00aaaa">void</span> *ptr )
*) ptr;
"</span>, message);
</pre></div>
(A) Thread-2
(B) Thread-1
(C) Error
(D) None