Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #25792

Re: Asynchronous programming using standard C

From Nobody <nobody@nowhere.com>
Subject Re: Asynchronous programming using standard C
Date 2012-09-03 03:09 +0100
Message-Id <pan.2012.09.03.02.10.03.657000@nowhere.com>
Newsgroups comp.lang.c
References <k20mi4$eg7$1@speranza.aioe.org>
Organization Zen Internet

Show all headers | View raw


On Sun, 02 Sep 2012 23:28:18 +0100, Chicken McNuggets wrote:

> I assume that asynchronous programming is generally done by calling a 
> function (which includes a call back function pointer in its arguments) 
> which starts a thread and then immediately returns. Once the thread has 
> completed the task it then calls the call back function to return the 
> data to the caller.
> 
> Is this the basic idea of asynchronous programming or have I got it 
> completely wrong?

That is one specific example of an asynchronous system.

Other examples might have the thread invoke the callback whenever
something interesting happens, not just on completion, or might avoid the
callback and have the initiator poll for updates. Or there may not be a
separate thread, just an event-processing loop which invokes callbacks as
events arrive (the callbacks are synchronous with respect to the
event-dispatching function but asynchronous with respect to the code which
installed them or which triggered the event).

"Asynchronous" generally just means that code is structured to accept
information as it becomes available rather than blocking until the
information is provided.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Asynchronous programming using standard C Chicken McNuggets <chicken@mcnuggets.com> - 2012-09-02 23:28 +0100
  Re: Asynchronous programming using standard C Nobody <nobody@nowhere.com> - 2012-09-03 03:09 +0100
    Re: Asynchronous programming using standard C Chicken McNuggets <chicken@mcnuggets.com> - 2012-09-03 11:43 +0100

csiph-web