...
Wiki Markup |
---|
If the JVM interacts with a file system that operates over an unreliable network, file I/O might incur a large performance penalty. In such cases, avoid file I/O over the network when holding a lock. File operations (such as logging) that may block waiting for the output stream lock or for I/O to complete may be performed in a dedicated thread to speed up task processing. Logging requests can be added to a queue given that the queue's {{put()}} operation incurs little overhead as compared to file I/O \[[Goetz 2006|AA. Java References#GoetzBibliography#Goetz 06]\]. |
Noncompliant Code Example (Deferring a Thread)
...
Wiki Markup |
---|
According to the Java API class {{Object}} documentation \[[API 2006|AA. Java References#APIBibliography#API 06]\] |
Note that the
wait
method, as it places the current thread into the wait set for this object, unlocks only this object; any other objects on which the current thread may be synchronized remain locked while the thread waits. This method should only be called by a thread that is the owner of this object's monitor.
...
Wiki Markup |
---|
\[[API 2006|AA. Java References#APIBibliography#API 06]\] Class {{Object}} \[[Grosso 2001|AA. Java References#GrossoBibliography#Grosso 01]\] [Chapter 10: Serialization|http://oreilly.com/catalog/javarmi/chapter/ch10.html] \[[JLS 2005|AA. Java References#JLSBibliography#JLS 05]\] [Chapter 17, Threads and Locks|http://java.sun.com/docs/books/jls/third_edition/html/memory.html] \[[Rotem 2008|AA. Java References#RotemBibliography#Rotem 08]\] [Falacies of Distributed Computing Explained|http://www.rgoarchitects.com/Files/fallacies.pdf] |
...