permaculture playing cards*
The moose likes Threads and Synchronization and the fly likes Synchronous/Asynchronous Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Synchronous/Asynchronous" Watch "Synchronous/Asynchronous" New topic
Author

Synchronous/Asynchronous

Malhar Me
Greenhorn

Joined: Jun 22, 2009
Posts: 27
Hi,

How can we implement Synchronous/Asynchronous method call in java (at server side).
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4167
    
  21

Malhar Me wrote:Hi,

How can we implement Synchronous/Asynchronous method call in java (at server side).


Synchronous methods are implemented by simply calling one method after the other:


Asynchronous method calls are done using Threads, where each method (or task) you want to perform is executed in a different Thread, possibly with call backs or synchronization to communicate completion. There are a handful of tools which will make the job easier - read up on ExecutorService, Future, and CompletionService. You should also familiarize yourself with Concurrency Chapter of the Java Tutorial.


Steve
Malhar Me
Greenhorn

Joined: Jun 22, 2009
Posts: 27
Thanks Steve!!!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Synchronous/Asynchronous
 
Similar Threads
Synchronous or Asynchronous Method?
javascript-AJAX regarding
Synchronous and asynchronous GC
Publisher/Sub and Point to Point..
Synchronous & Asynchronous Arcitectures