ANSWERS WITH COMPLETE SOLUTIONS VERIFIED
LATEST UPDATE
In what situations can a deadlock occur? Select all that apply
- There are two shared resources.
- There are more than two shared resources.
- There is no shared resource.
- There is one shared resource.
- There are two shared resources
-
Ethernet's binary exponential backoff mechanism is a technique used for
avoiding
livelock
A thread
exists when the corresponding code is running
Compare and contrast livelock and deadlock. What statement is correct?
In the case of deadlock, the resources are held. In the case of livelock, the resources
are still free.
, What technique can be used to make sure that parallel withdrawals from ATMs
cannot exceed the given limit of a bank account?
Implement a lock mechanism to prevent simultaneous access to the account object.
What is the proper way of creating a thread class if the class has already
inherited members from another class?
Implement the Runnable Interface
Which method is the starting point in a user-defined Java thread class?
run
Compare and contrast wait( ) and sleep(t) methods defined in the library class
Thread.
A thread in the wait state cannot return to the ready state unless another thread issues
a notification.
How is the synchronization mechanism implemented in a Java environment?
A lock-bit in an object is set to "true" when a synchronized method accesses the object.
If a method is prefixed with the keyword "synchronized", then
all objects accessed by the method will be locked during the execution of the method.
Can Monitor.Enter(v) lock the variable v if v is of integer type?
No, Monitor.Enter(v) cannot directly lock the variables of value-type.
Which method is the starting point in a user-defined C# thread class?
a user-named method
The C# monitor class's methods Monitor.Enter and Monitor.Exit can be used for
synchronizing a set of statements, similar to the synchronized statements in Java.