dcsimg
Threads
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Thrihesh_Rai
Posted On:   Thursday, July 3, 2003 05:27 AM

can 2 threads enter the samefunction at the constant time

Re: Threads

Posted By:   c_m  
Posted On:   Tuesday, July 15, 2003 02:44 AM

Synchronization addresses the issue of shared memory access, and therefore should only be used for this purpose. This includes accessing same data from different methods in the same object, aswell from the same method. Local variables defined within the method are stack based and therefore implicitly thread-safe - separate threads get different variables. Keep synchronized blocks to an absolute minimum, they impact performance.


www.liemur.co.uk

Re: Threads

Posted By:   Nick_Maiorano  
Posted On:   Thursday, July 3, 2003 07:14 PM

Thrihesh,



Can 2 threads enter the same method at the same time? Absolutely! You need to use synchronized methods to prevent this from happening.

About | Sitemap | Contact