How can I achieve exclusive writing but non-exclusive reading? Can I synchronizeaccess the installer and make a variable volatile? is that enough?
synchronize
volatile
Look at the Java5 parallel api:
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/locks/ReadWriteLock.html
This will satisfy your requirement, as you can allow multiple threads to read without locking and locking only when writing.
Here's an interesting post comparing this api with a traditional synchronous read: ReentrantReadWriteLock vs synchronized
, @assylias , , .
, volatile , :
. , :_ , ._ .
. , :
_ , .
_ .