Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Synchronous and Asynchronous ???

 
Ja vardhan
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Thanks.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic