I need a hint how to implement asynchronous function calls in C/C++ ( or names of frameworks/API calls for windows and/or linux )
The use case is following: A parent thread calls a function. The function creates a child thread and returning, so call is non-blocking and parent thread can continue to do some job.
For example pthread_join to get result is not suitable, so result must be stored somewhare in heap and parent must be notified about. What I want is something like callback function in parent thread, that would be executed after child thread is ready with job.
This is surprising, but I can not find a single example in google.
Thanks for help
Use Qt framework and Thread classes or the Qt Concurrency framework.
Connect to QThread::finished() or QFutureWatcher::finished() signal to be notified when the work is done.
Use boost::thread as the standard cross-platform solution. If you need something more involved, there's Intel's Thread Building Blocks.