| What do you understand by Synchronization |
|
|
|
| Written by Mukesh Ranjan | |
| Monday, 14 May 2007 | |
What do you understand by Synchronization
Synchronization is a process of controlling the access of shared resources by
the multiple threads in such a manner that only one thread can access one
resource at a time. In non synchronized multithreaded application, it is
possible for one thread to modify a shared object while another thread is in the
process of using or updating the object's value. Synchronization prevents such
type of data corruption. e.g. Synchronizing a function:
public synchronized void Method1 () { e.g. Synchronizing a block of code inside a function:
public myFunction (){ More infoFor more java related stuff visit Mukesh Ranjans site hereComments (0)
![]() Write comment
You must be logged in to a comment. Please register if you do not have an account yet.
Copyright 2007. All Rights Reserved. |