matthew016
asked on
Simple synchronized question
Hi,
let's say I have this :
class A {
public synchronized void a() {
}
public synchronized void b() {
}
}
will the requests queue up for each method, or for the class ?
I mean : if two requests want to access method b, one will access and other requests will be in a queue.
What happen if one request want to access a and another want to access b at the same time ?
Tthe synchronized keyword bears upon the method or the whole class ?
let's say I have this :
class A {
public synchronized void a() {
}
public synchronized void b() {
}
}
will the requests queue up for each method, or for the class ?
I mean : if two requests want to access method b, one will access and other requests will be in a queue.
What happen if one request want to access a and another want to access b at the same time ?
Tthe synchronized keyword bears upon the method or the whole class ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:-)
ASKER