That's completely up to you and depends on the approach you will follow (thin vs thick client). You can generate a unique client identification number (the approach I followed, use search engine with setClientId for more information), you could use sockets as networking protocol, use the RMI factory pattern (as described in andrew's book) and so onHow should we handle this?
Now I understand both synchronized(data) parts in the beginning and the end.
Seems to me you set the client id once and then have calls to methods lock, update and unlock, all in 1 atomic operation.Yu Sun wrote:synchronized { setId(); lock() / update() / unlock() } blocks
Consider Paul's rocket mass heater. |