Frage im Vorstellungsgespräch bei LinkedIn

Write put/get methods for a BlockingQueue

Antwort im Vorstellungsgespräch

Anonym

13. Apr. 2012

In Java, just make the methods synchronized.When one thread is executing a synchronized method for an object, all other threads that invoke synchronized methods for the same object block (suspend execution) until the first thread is done with the object. }