When one thread is executing a synchronized method for an object, all other threads that invoke synchronized methods for the same object block.
What is happen when too many threads (for the same object) for example 100 Threads invoke this method and want to send data?
In which order can the Threads be executed?
Is there any queueing or buffering here?
If there is buffering, how long does it take to release the buffering data?
private Lock sendMessageLock = new ReentrantLock();
public Response send(SMTInitiated data) {
[B]synchronized [/B](sendMessageLock) {
return send(data);
}
}