File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes OO, Patterns, UML and Refactoring and the fly likes Synchronous and Asynchronous ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Synchronous and Asynchronous ???" Watch "Synchronous and Asynchronous ???" New topic

Synchronous and Asynchronous ???

Ja vardhan
Ranch Hand

Joined: May 09, 2005
Posts: 169

Can you please tell the exact meanings of synchronous and asynchronous communications?


Frank Carver

Joined: Jan 07, 1999
Posts: 6920
Synchronous is where the sender of a request sits around doing nothing waiting for a response.

Asynchronous is where a request is sent then the sender gets on with other stuff. Replies may come back later from the recipient.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Conversation is usually synchronous. I say something, then wait for you to reply. During that wait it would be rude of me to do something else like play a game on my phone, so I don't.

But postal mail communication is asynchronous. I send you a letter and then go on with my life for a couple days. When you send a reply I rip it open and read it.

Ordinary method calls are synchronous. I call someobject.method() and block until that returns.

If I start another thread I may get an asynchronous reply. I can go on and do other things while the other thread runs, and it may call my object back some time in the future.

Message queuing is often (but not always) asynchronous. Any kind of multi-threaded program like a Swing UI can get into async territory, too.

Does that help?
[ May 24, 2006: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link:
subject: Synchronous and Asynchronous ???
It's not a secret anymore!