Mutliple thread access to object method  
Author Message
Crouchez





PostPosted: 2007-8-31 1:59:00 Top

java-programmer, Mutliple thread access to object method Can multiple threads access the same object public void method
simultaneously? Or does the method need to return for each thread? I guess
not because that's what public synchronized void is for?


 
Manish Pandit





PostPosted: 2007-8-31 2:03:00 Top

java-programmer >> Mutliple thread access to object method On Aug 30, 10:59 am, "Crouchez"
<email***@***.com> wrote:
> Can multiple threads access the same object public void method
> simultaneously? Or does the method need to return for each thread? I guess
> not because that's what public synchronized void is for?

Your guess is right - they can access the method concurrently, unless
it is synchronized.

-cheers,
Manish

 
Lew





PostPosted: 2007-8-31 4:35:00 Top

java-programmer >> Mutliple thread access to object method "Crouchez" wrote:
>> Can multiple threads access the same object public void method
>> simultaneously? Or does the method need to return for each thread? I guess
>> not because that's what public synchronized void is for?

Manish Pandit wrote:
> Your guess is right - they can access the method concurrently, unless
> it is synchronized ...

... on the same monitor.

--
Lew