dcsimg
Thread Access to a resource at the same time
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Madhusudhan_Rao
Posted On:   Thursday, May 31, 2007 02:15 AM

Hi All




I wanted to know what happens if two or more thread tries to aceess a resource , say a vector at the same time...





whether both gets into the vector and modifies the value or only one will get the access to the vector...





regards


Madhu

Re: Thread Access to a resource at the same time

Posted By:   Robert_Lybarger  
Posted On:   Thursday, May 31, 2007 09:13 AM

depends on whether that "resource" is specifically coded to allow threads to safely interact with it. for java foundation classes, check if the API docs indicate "thread-safe" or "not thread-safe". For your own classes, they aren't thread-safe unless you take all proper measures to make them so.
About | Sitemap | Contact