Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Synchronous and Asynchronous ???

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

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

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.
(instanceof Sidekick)
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 ]
Those who dance are thought mad by those who hear not the music. This tiny ad plays the bagpipes:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic