Home Tutorialhelp Comment The above examples aren't properly synchronized

 
 

Comment

Lasitha
The above examples aren't properly synchronized,
December 22, 2008 at 9:18 PM

Please consider the fact that the above to examples does not show proper synchronization due to the fact that there are two share objects and hence there are two share Object locks. So thread one and thread two can mix up together.

A way to avoid this would be to make the display method "static" and making it a method that would be shared by all instances, and not having their own copy of it
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Advertisements Advertisements
 

 

 

DMCA.com