After looking at some literature for exam 1Z0-804, I find this example for him:
Consider the following program:
class ATMRoom { public static void main(String []args) { Semaphore machines = new Semaphore(2);
Which parameter is true if you replace statement # 1 with the following expression? Semaphore machines = new Semaphore(2, true);
Omitting Answers
Explaining the correct answer caught my attention:
The second parameter specifies the equity policy of the semaphore object. However, there are two permissions for the semaphore object; therefore, you cannot predict the order in which waiting people will receive permission to access the ATM.
I would say that the order cannot be predicted simply because of the non-deterministic nature of the flows, and not because of the number of permissions in the Semaphore, and that the justice parameter ensures that the waiting flows are awakened in the same order they acquired the semaphore, but still the acquisition order cannot to be determined. Is my interpretation correct?
source share