Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Synchronous and asynchronous call

This is a discussion on Synchronous and asynchronous call within the Unix/Linux forums, part of the Operating Systems category; What is the difference between synchronous and asynchronous call? How does the operating system manage the both?...

Go Back   Geeks Talk > Operating Systems > Unix/Linux
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 03-24-2009
Junior Member
 
Join Date: Mar 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
xyz123456 is on a distinguished road
Synchronous and asynchronous call

What is the difference between synchronous and asynchronous call? How does the operating system manage the both?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-25-2009
Contributing Member
 
Join Date: Dec 2007
Posts: 48
Thanks: 1
Thanked 8 Times in 7 Posts
sk_seeker is on a distinguished road
Re: Synchronous and asynchronous call

You mention operating systems. So, I will assume synchronous and asynchronous system calls. Let us take a non-CS example.

I want to buy some tablet and so I go to the medical store. I give the prescription to the pharmacist and wait at the desk until he retrieves it from storage. I only leave the desk after getting the tablet. This is an example of a synchronous call i.e. while I am waiting for the tablet, I can do nothing else but wait for my result i.e. wait for the tablet.

Consider the same example, but the pharmacist tells me that the tablet is out of stock and he will get it from the market. He also tells me to leave my phone number and he would call me when he actually gets the tablet. A couple days later, I get a call from the pharmacist and I go pick up the tablets. This is an example of an asynchronous call i.e. I am not waiting for the tablet at the store: I am off doing other things for a couple of days until the pharmacist calls my phone number and asks me to collect the tablet.

Synchronous system calls are synchronous in time i.e. until the call returns, the calling context is blocked from doing anything. Asynchronous calls are just the opposite i.e. async calls just post a request and later get a call from the operating system.

To understand this better, read the man page for read(2) system call and study the O_SYNC and O_ASYNC options. And, also study UNIX signal handling.

Hope that helps.
Reply With Quote
  #3 (permalink)  
Old 3 Weeks Ago
Junior Member
 
Join Date: Nov 2009
Location: Gurgaon
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
sjbupi is on a distinguished road
Re: Synchronous and asynchronous call

The example is quite good but our need is to make an asynchronous call and then do the task based on the resultset returned by that call. How can we manage this?
Reply With Quote
Reply

  Geeks Talk > Operating Systems > Unix/Linux

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Call by Value and Call by Reference Lokesh M C and C++ 2 06-23-2009 03:29 AM
Function call Paresh15 C and C++ 4 01-05-2009 07:49 AM
call scenario sunny78 QTP 0 11-19-2008 09:28 AM
call scenario sunny78 QTP 0 11-19-2008 09:27 AM
can we call Finalize() ? atnbhushan Java 0 02-22-2008 08:05 AM


All times are GMT -4. The time now is 12:59 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved