01-01-2013 09:15 PM
Avoid missing reading a value.
Try to lock a value, after value is wrote into a report. Unlock will be active.
If anyone knows how to do that, please share your idea.
Thanks your attention.
01-02-2013 05:03 AM
As I understand this, the basic idea here is that you hold the lock while you are processing and need exclusive access to some resource. You can do the same sort of thing using synchronized blocks of code, you just need to make sure that all the Threads are using a shared Object.
The other way this could be used and the way you seem to be trying to use it here, is as a notification mechanism. In that case this is replacing a wait/notify. The Server thread has an object that it will 'wait' on. Client Threads will 'notify' this object when they have added processing for the Server thread to work on.
Have I understood the question?