AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

synchronized

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian)
View previous topic :: View next topic  
Author Message
Marco
Guest





PostPosted: Thu Apr 20, 2006 6:12 am    Post subject: synchronized Reply with quote



1) Se un metodo A è synchronized, è possibile che due thread eseguano
contemporaneamente due istanze di dello STESSO metodo A (spero di no)?

2) Se un metodo A è synchronized, è possibile che un metodo B non
synchronized (conpreso run()) venga eseguito da un altro thread
contemporaneamente ad A finchè non richiama altri metodi synchronized (spero
di sì)?
Back to top
Vincent Vega
Guest





PostPosted: Thu Apr 20, 2006 7:12 am    Post subject: Re: synchronized Reply with quote



Marco wrote:

Quote:
1) Se un metodo A è synchronized, è possibile che due thread eseguano
contemporaneamente due istanze di dello STESSO metodo A (spero di no)?

No.

Quote:
2) Se un metodo A è synchronized, è possibile che un metodo B non
synchronized (conpreso run()) venga eseguito da un altro thread
contemporaneamente ad A finchè non richiama altri metodi synchronized (spero
di sì)?

Esattamente così.
Precisando che quando parli di "altri metodi synchronized" si intende
dello stesso oggetto, i lock si applicano a livello di oggetto.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.