multithreading - Java: waiting on synchronized block, who goes first? - Stack Overflow
Someone else mentioned the availability of fair locks. If you really care who goes first, then you may have a real-time problem. In that case, you can make use of RTSJ, wherein the ordering and other semantics of lock acquisition is specified. The specifics are available in the RTSJ Spec under Synchronization. Quoting from the rationale section:
Read full article from multithreading - Java: waiting on synchronized block, who goes first? - Stack Overflow
No comments:
Post a Comment