Font size
WorksheetsSynchronization Problems Quiz
Total questions: 27
Worksheet time: 1hrs 1mins
What is the producer-consumer problem?
A problem where producers create data and consumers use it.
A problem where consumers create data and producers use it.
A problem that involves only producers.
A problem that involves only consumers.
What is a semaphore?
A signaling mechanism.
A type of mutex.
A data structure.
A programming language.
What is the purpose of a barrier in synchronization?
To ensure all threads reach a certain point before continuing.
To allow threads to run independently.
To manage memory allocation.
To prevent deadlocks.
What is the dining philosophers problem?
A problem that illustrates synchronization issues.
A problem that involves only one philosopher.
A problem that does not involve resources.
A problem that is easily solvable.
What is the readers-writers problem?
A problem that deals with resource sharing between readers and writers.
A problem that only involves readers.
A problem that only involves writers.
A problem that does not require synchronization.
How do we know if A happened before B?
What is the simplest model of how computer programs run?
What happens when a computer is parallel?
What is a thread?
What is the issue with synchronization in parallel and multithread models?
How can you guarantee that tomorrow you will eat lunch before Bob?
What is message passing in the context of synchronization?
What does it mean for two events to be concurrent?
What is non-determinism in concurrent programs?
What are shared variables in the context of threads?
What value of x gets printed? What is the final value of x when all these statements have executed?
What path yields output 5 and final value 5?
What path yields output 7 and final value 7?
Is there a path that yields output 7 and final value 5? Can you prove it?
Assuming that the initial value of x is 0, what is its final value?
What is the minimum number of messages that is required?
Describe what semaphores are often used for.
Why are semaphores useful?
They impose deliberate constraints that help programmers avoid errors.
They are not needed to solve synchronization problems.
They make solutions messy and hard to understand.
They can only be implemented on specific systems.
What is the simplest use for a semaphore?
To signal between threads.
To block threads indefinitely.
To create deadlocks.
To enforce mutual exclusion.
Generalize the signal patterns so that it works both ways.
What is a mutex?
A type of semaphore.
A token that allows one thread to proceed.
A method to create deadlocks.
A way to block all threads.
Add semaphore to enforce mutual exclusion to the shared variable count.
