| TheJavaCode.com http://www.thejavacode.com/ |
|
| Synchronized or non Synchronized http://www.thejavacode.com/viewtopic.php?f=30&t=9727 |
Page 1 of 1 |
| Author: | msafwat [ Mon Aug 30, 2010 7:07 pm ] |
| Post subject: | Synchronized or non Synchronized |
What does synchronized means? It means a way or method to enforce the mutual exclusion of critical section. Or in other word, there is mutual variables share by different threads. Synchronization guarantees that when there is any updates made are visible to other threads as well. Using of synchronized blocks would provide both functions which are mutual exclusion and visibility of updates. For those threads use synchronized blocks, it requires that to use the same lock object. Why we need to do synchronization? To ensure there is only one thread is executable to access the field. Or when you are writing the data which have been written for another thread or will be written for other thread later on, then you should do the synchronization. However, for those who have no knowledge on IT aspects, it is strange for them. What happens if they have the problem in technology? They can go for software consulting. |
|
| Author: | khalil [ Wed Sep 15, 2010 7:14 pm ] |
| Post subject: | Re: Synchronized or non Synchronized |
This is the source for many thread blocking in the code |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|