Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Asynchronous programming using standard C

Reply
Thread Tools

Asynchronous programming using standard C

 
 
Chicken McNuggets
Guest
Posts: n/a
 
      09-02-2012
I'm interested in asynchronous programming but am having a few problems
understanding the underlying implementation.

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?

Thankfully threading is now on-topic in this group thanks to C11.

Thank you for any help.
 
Reply With Quote
 
 
 
 
Nobody
Guest
Posts: n/a
 
      09-03-2012
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.

 
Reply With Quote
 
 
 
 
Chicken McNuggets
Guest
Posts: n/a
 
      09-03-2012
On 03/09/2012 03:09, Nobody wrote:
> 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.
>


Ah. Thanks for your response. That makes sense.
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Standard Asynchronous Python Dustin J. Mitchell Python 7 09-16-2012 06:45 AM
Re: Standard Asynchronous Python Oscar Benjamin Python 0 09-10-2012 01:40 PM
Re: Standard Asynchronous Python Dennis Lee Bieber Python 0 09-10-2012 05:44 AM
[J2EE] Standard asynchronous call zebulon Java 1 01-24-2006 09:30 PM
Asynchronous HTTP server in standard library ? Pierre Quentel Python 2 01-10-2004 05:46 PM



Advertisments