Each Java Virtual Machine executes many threads at once. All threads execute their internal code and operate their values in a shared memory space.
As we know, Synchronization is a process which executes only one thread at a time. To Synchronize, Java programming language uses monitors which is used to allow only one thread at a time to execute a region of code.
Monitors explained in terms of locks. The synchronized statement performs two special actions relevant only to multithreaded operation:
Please see another article: Difference between JRE and JDK for further clarification of Java.
As we know, Synchronization is a process which executes only one thread at a time. To Synchronize, Java programming language uses monitors which is used to allow only one thread at a time to execute a region of code.
Monitors explained in terms of locks. The synchronized statement performs two special actions relevant only to multithreaded operation:
- after computing a reference to an object but before executing its body, it closes a lock associated with the object.
- after execution of the body has completed, either normally or abruptly, it unlocks that same lock
Please see another article: Difference between JRE and JDK for further clarification of Java.
No comments:
Post a Comment