How do Java threads make the environment asynchrnous?


Ans: The thread mechanism in Java begins with the main entry point thread the runtime environment creates to start a Java program. When you use that initial thread create secondary threads, each one runs independently of the other. The Java virtual machine manages the execution of the threads so they behave as if they all run at the same time, in fact each thread briefly takes turns at execution.

In its simplest form there may be no communication or synchronization between multiple threads in a Java program and they each run to completion independently of each other. In this respect Java threads are fundamentally asynchronous, there is no master clock that governs when threads will run and when they synchronize variables to “catch-up” with each other.

It is often necessary and more useful if threads do check ready states before progressing, synchronize read and write access to shared variables and call-back to each other when their work is done. This is where the synchronized keyword and the various sleep(), wait() and notify() methods are used to more closely schedule the interaction between asynchronous threads.

People who read this post also read :



1 comments:

Did you hear there is a 12 word phrase you can communicate to your man... that will induce deep emotions of love and impulsive attractiveness to you buried within his chest?

Because hidden in these 12 words is a "secret signal" that fuels a man's impulse to love, admire and look after you with all his heart...

====> 12 Words Who Trigger A Man's Love Instinct

This impulse is so built-in to a man's genetics that it will drive him to try harder than before to to be the best lover he can be.

As a matter of fact, triggering this powerful impulse is absolutely mandatory to having the best ever relationship with your man that the moment you send your man one of the "Secret Signals"...

...You'll instantly find him open his heart and soul for you in a way he haven't expressed before and he will recognize you as the one and only woman in the galaxy who has ever truly appealed to him.

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More