Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Synchronous/Asynchronous

 
Malhar Me
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How can we implement Synchronous/Asynchronous method call in java (at server side).
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Malhar Me
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Steve!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic