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. |
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?...
|
|||||||
|
|||
|
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. |
|
|||
|
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?
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
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 |