1

I have a device that is a source of data. It is connected to a PC where my program is running. I have two scenarios of how to get the data from that device.

I am wondering, which one is synchronous and which is asynchronous data transmission?

  1. I start the device and my program executes a thread that periodically polls the device for new data.
  2. I register a callback function in my program with the device and whenever there is new data available, the device calls my callback function.
Niall
1,8511 gold badge18 silver badges21 bronze badges
asked Aug 4, 2015 at 11:23
2
  • 2
    Neither are synchronous. See en.wikipedia.org/wiki/… Commented Aug 4, 2015 at 14:40
  • Synchronous vs. Asynchronous is a property of the internal threading of some program. One-way vs. Round-Trip (and push vs. pull) are properties of message transmission. These sets of terms are related but describe different aspects of programming and system construction. Commented Aug 4, 2015 at 16:39

2 Answers 2

1

I'm not really sure the title question relates to the question in the post. I am assuming that the IO operations seem to be the correct question here.

Synchronous and asynchronous IO operations

This would normally mean that a request to IO would wait for a response before execution continues. Asynchronous operation make a request to IO, typically together with a callback or an identified signal that is then used by the IO handler to callback or signal the original caller of the result.

In your question; 1 would be typical of synchronous operations, and 2 for asynchronous operations.


Side note:

Synchronous and asynchronous data transmission

This relates to the synchronised (or not) communication of the underlying physical link (on the wire if you will). In synchronous schemes, there is typically a clock line that synchronises clients on the wire. In the absence of a clock, clients could attempt to access the line at any point.

answered Aug 4, 2015 at 11:54
0

Neither is a synchronous operation. In both cases your program will continue running while the data loads, and will later get the data once it finishes loading. That is an asynchronous approach to loading data.

Synchronous data loading would be if the program stops entirely until the data is loaded.

answered Aug 4, 2015 at 16:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.