95
68.7k
Chapter:

20+ Parallel Program Challenges Solved MCQs

in Muli-core Architectures and Programming

These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Computer Science Engineering (CSE) , Programming Languages .

Chapters

Chapter: Parallel Program Challenges
1.

Producer consumer problem can be solved using _____________

A. semaphores
B. event counters
C. monitors
D. All of the above
Answer» C. monitors
2.

A situation where several processes access and manipulate the same data concurrently and the outcome of the execution depends on the particular order in which access takes place is called:

A. data consistency
B. race condition
C. aging
D. starvation
Answer» B. race condition
3.

The segment of code in which the process may change common variables, update tables, write into files is known as :

A. program
B. critical section
C. non – critical section
D. synchronizing
Answer» B. critical section
4.

All deadlocks involve conflicting needs for __________

A. Resources
B. Users
C. Computers
D. Programs
Answer» A. Resources
5.

___________ are used for signaling among processes and can be readily used to enforce a mutual exclusion discipline.

A. Semaphores
B. Messages
C. Monitors
D. Addressing
Answer» A. Semaphores
6.

To avoid deadlock ____________

A. there must be a fixed number of resources to allocate
B. resource allocation must be done only once
C. all deadlocked processes must be aborted
D. inversion technique can be used
Answer» A. there must be a fixed number of resources to allocate
7.

A minimum of _____ variable(s) is/are required to be shared between processes to solve the critical section problem.

A. one
B. two
C. three
D. four
Answer» B. two
8.

Spinlocks are intended to provide __________ only.

A. Mutual Exclusion
B. Bounded Waiting
C. Aging
D. Progress
Answer» B. Bounded Waiting
9.

To ensure difficulties do not arise in the readers – writer’s problem, _______ are given exclusive access to the shared object.

A. readers
B. writers
C. readers and writers
D. none of the above
Answer» B. writers
10.

If a process is executing in its critical section, then no other processes can be executing in their critical section. This condition is called ___________.

A. Out-of-order execution
B. Hardware prefetching
C. Software prefetching
D. mutual exclusion
Answer» D. mutual exclusion
11.

A semaphore is a shared integer variable ____________.

A. lightweight process
B. that cannot drop below zero
C. program counter
D. stack space
Answer» B. that cannot drop below zero
12.

A critical section is a program segment ______________.

A. where shared resources are accessed
B. single thread of execution
C. improves concurrency in multi-core system
D. Lower resource consumption
Answer» A. where shared resources are accessed
13.

A counting semaphore was initialized to 10. Then 6 P (wait) operations and 4V (signal) operations were completed on this semaphore. The resulting value of the semaphore is ___________

A. 4
B. 6
C. 9
D. 8
Answer» D. 8
14.

A system has 3 processes sharing 4 resources. If each process needs a maximum of 2 units, then _____________

A. Better system utilization
B. deadlock can never occur
C. Responsiveness
D. Faster execution
Answer» B. deadlock can never occur
15.

_____________ refers to the ability of multiple process (or threads) to share code, resources or data in such a way that only one process has access to shared object at a time.

A. Readers_writer locks
B. Barriers
C. Semaphores
D. Mutual Exclusion
Answer» D. Mutual Exclusion
16.

____________ is the ability of multiple processes to co-ordinate their activities by exchange of information.

A. Deadlock
B. Synchronization
C. Mutual Exclusion
D. Cache
Answer» B. Synchronization
17.

Paths that have an unbounded number of allowed nonminimal hops from packet sources, this situation is referred to as __________.

A. Livelock
B. Deadlock
C. Synchronization
D. Mutual Exclusion
Answer» A. Livelock
18.

Let S and Q be two semaphores initialized to 1, where P0 and P1 processes the following statements wait(S);wait(Q); ---; signal(S);signal(Q) and wait(Q); wait(S);---;signal(Q);signal(S); respectively. The above situation depicts a _________.

A. Livelock
B. Critical Section
C. Deadlock
D. Mutual Exclusion
Answer» C. Deadlock
19.

Which of the following conditions must be satisfied to solve the critical section problem?

A. Mutual Exclusion
B. Progress
C. Bounded Waiting
D. All of the mentioned
Answer» D. All of the mentioned
20.

Mutual exclusion implies that ____________.

A. if a process is executing in its critical section, then no other process must be executing in their critical sections
B. if a process is executing in its critical section, then other processes must be executing in their critical sections
C. if a process is executing in its critical section, then all the resources of the system must be blocked until it finishes execution
D. none of the mentioned
Answer» A. if a process is executing in its critical section, then no other process must be executing in their critical sections
21.

Bounded waiting implies that there exists a bound on the number of times a process is allowed to enter its critical section ____________.

A. after a process has made a request to enter its critical section and before the request is granted
B. when another process is in its critical section
C. before a process has made a request to enter its critical section
D. none of the mentioned
Answer» A. after a process has made a request to enter its critical section and before the request is granted
22.

What are the two atomic operations permissible on semaphores?

A. Wait
B. Stop
C. Hold
D. none of the mentioned
Answer» A. Wait
23.

What are Spinlocks?

A. CPU cycles wasting locks over critical sections of programs
B. Locks that avoid time wastage in context switches
C. Locks that work better on multiprocessor systems
D. All of the mentioned
Answer» D. All of the mentioned
24.

What is the main disadvantage of spinlocks?

A. they are not sufficient for many process
B. they require busy waiting
C. they are unreliable sometimes
D. they are too complex for programmers
Answer» B. they require busy waiting
25.

The signal operation of the semaphore basically works on the basic _______ system call.

A. continue()
B. wakeup()
C. getup()
D. start()
Answer» B. wakeup()
26.

If the semaphore value is negative ____________.

A. its magnitude is the number of processes waiting on that semaphore
B. it is invalid
C. no operation can be further performed on it until the signal operation is performed on it
D. none of the mentioned
Answer» A. its magnitude is the number of processes waiting on that semaphore

Done Studing? Take A Test.

Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.