class Semaphore {
private int count=100;
public Semaphore(int n) {
this.count = n;
}
public synchronized void acquire() {
while(count == 0) {
try {
wait();
} catch (InterruptedException e) {
//keep trying
}
}
count--;
}
public synchronized void release() {
count++;
notify(); //alert a thread that's blocking on this semaphore
}
}
bildirmek ihtiyacınız. Eğer jsp (Client) 'dan bir talep gelirse ve bu sınıftan geçerse, Thread (JSP'den gelen talep) wait
ve notify
otomatik olarak mı?anlayış Konu pusuya yardımcı ve Şu anda 100 kullanıcı destekliyorum