C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 06-16-2008, 12:09 AM   #1
Registered User
 
Join Date: Jun 2008
Posts: 1
Question How do wait till a callback function returns

Hi,
I am writing a library. Any exe will build with this library. The library exposes a API which the exe calls. The API inturn registers a callback function. Now how do i wait for the control to return to this callback function. So the sequence of operations is as follows

1) Api Call
2) Call another lib API and register Callback function
3) Process the result in call back function
4) Resume operation from the point where we call the next lib api and register the callback ie from point 2
5)further process the data in the first API
6) return the result of the API call to the exe

TIA
poorkoder is offline   Reply With Quote
Old 06-16-2008, 11:22 AM   #2
Registered User
 
Codeplug's Avatar
 
Join Date: Mar 2003
Posts: 3,844
Are you wrapping an asynchronous API with a synchronous API? In other words, does the underlying API invoke the callback within the context of another thread? Or does the callback get invoked within the same thread that performed step #2?

Windows or *nix or both?

gg
Codeplug is offline   Reply With Quote
Reply

Tags
api, c programming, callbacks, semaphores, waiting

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Delegate function implementation in C++ for class callback invocation just_me Windows Programming 1 08-24-2008 11:39 AM
Screwy Linker Error - VC2005 Tonto C++ Programming 5 06-19-2007 02:39 PM
Including lib in a lib bibiteinfo C++ Programming 0 02-07-2006 02:28 PM
Please Help - Problem with Compilers toonlover C++ Programming 5 07-23-2005 10:03 AM
Question.. pode Windows Programming 12 12-19-2004 07:05 PM


All times are GMT -6. The time now is 03:40 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22