CSCI 316: Quiz 11 - Concurrency
Sign in to Google
to save your progress.
Learn more
* Indicates required question
Email
*
Your email
Last Name
*
Your answer
First Name
*
Your answer
Student Id
*
Your answer
The primary goal of concurrency mechanisms in programming languages is to
*
1 point
replace parallel hardware
allow multiple logical threads of control to execute
eliminate the need for synchronization
ensure deterministic execution order
improve program readability
Which of the following best distinguishes concurrency from parallelism?
*
1 point
Concurrency cannot improve performance
Parallelism is a language feature
Parallelism forbids shared memory
Concurrency is about program structure, not hardware
Concurrency requires multiple CPUs
A race condition occurs when
*
1 point
a semaphore value is negative
message passing is synchronous
monitors enforce mutual exclusion
two threads execute sequentially
shared data is accessed without proper synchronization
Which concurrency problem arises when two or more processes wait indefinitely for resources held by each other?
*
1 point
deadlock
livelock
preemption
busy waiting
starvation
Subprogram-level concurrency typically treats concurrent units as
*
1 point
blocks
exceptions
objects
threads
expressions
A semaphore is best described as
*
1 point
a scheduler
a protected object
a message queue
an integer variable accessed by special operations
a mutual exclusion block
The two fundamental semaphore operations are
*
1 point
send and receive
lock and unlock
wait and signal
start and join
enter and leave
Which semaphore misuse can lead to busy waiting?
*
1 point
using blocking wait
using spinlocks
enforcing mutual exclusion
signaling too late
incorrect initialization
Counting semaphores differ from binary semaphores because they
*
1 point
allow values greater than one
are nonblocking
are only used in Ada
require monitors
cannot enforce mutual exclusion
A major disadvantage of semaphores is that they
*
1 point
are too restrictive
are inefficient
forbid shared variables
cannot express synchronization
are low-level and error-prone
Monitors were introduced primarily to
*
1 point
remove mutual exclusion
improve hardware utilization
eliminate concurrency
replace message passing
improve readability and safety of synchronization
In a monitor, mutual exclusion is
*
1 point
unavailable
automatic
optional
enforced by the programmer
handled by semaphores only
Condition variables in monitors are used to
*
1 point
replace semaphores
protect shared memory
enforce scheduling policies
create threads
allow threads to wait and be signaled
Which operation typically releases the monitor lock and suspends the calling process?
*
1 point
join
enter
wait
notifyAll
signal
Message passing concurrency avoids shared memory by
*
1 point
using immutable data
serializing execution
duplicating variables
exchanging information directly between processes
using global locks
Which is an advantage of message passing over shared memory?
*
1 point
simpler synchronization
higher execution speed
guaranteed determinism
direct variable access
no communication overhead
Asynchronous message passing differs because
*
1 point
receivers cannot block
it requires monitors
senders do not block
it enforces mutual exclusion
it forbids buffering
In Ada, the primary concurrent unit is the
*
1 point
task
thread
protected object only
monitor
process
Which Ada construct restricts concurrent access to shared data more safely than tasks?
*
1 point
packages
generics
exceptions
entries
protected objects
In Java, mutual exclusion is commonly implemented using
*
1 point
monitors via synchronized methods or blocks
atomic integers only
message passing
semaphores only
busy waiting loops
A key danger of Java’s original thread model was
*
1 point
absence of mutual exclusion
deterministic scheduling
lack of monitors
unsafe thread suspension
no message passing
C# threads are most similar to Java threads because they
*
1 point
eliminate race conditions
forbid shared memory
use only message passing
use Ada-style tasks
rely on monitors and locks
Concurrency in functional languages is often simplified by
*
1 point
mutable global state
shared variables
explicit semaphores
busy waiting
immutable data structures
Statement-level concurrency allows
*
1 point
only subprograms to run concurrently
removal of synchronization
individual statements to execute in parallel
sequential execution within blocks
concurrency only in Ada
A major limitation of statement-level concurrency is
*
1 point
deterministic execution
inability to express parallelism
difficulty in scaling to large programs
need for message passing
excessive flexibility
Which functional language feature reduces race conditions?
*
1 point
garbage collection
dynamic typing
immutability
lazy evaluation only
recursion
Starvation occurs when
*
1 point
a process holds a resource forever
threads execute too fast
two processes wait on each other
a process never gets scheduled
a semaphore value is zero
Fair scheduling attempts to ensure that
*
1 point
execution order is deterministic
no thread waits indefinitely
semaphores are unnecessary
all threads execute simultaneously
deadlock cannot occur
Which concurrency problem results when threads repeatedly yield to each other without making progress?
*
1 point
deadlock
race condition
livelock
starvation
preemption
Concurrency constructs aim to balance
*
1 point
compilation and interpretation
recursion and iteration
syntax and semantics
determinism and randomness
simplicity and expressiveness
A copy of your responses will be emailed to the address you provided.
Submit
Clear form
Never submit passwords through Google Forms.
reCAPTCHA
Privacy
Terms
This content is neither created nor endorsed by Google. -
Terms of Service
-
Privacy Policy
Does this form look suspicious?
Report
Forms
Help and feedback