Asynchronous function call for C++

前端 未结 8 718
面向向阳花
面向向阳花 2021-02-09 17:38

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 thr

8条回答
  •  甜味超标
    2021-02-09 18:21

    I see in your reply to Starkey that the main thread is a UI thread.

    I've used several different GUI toolkits and all of them allow you to post a message from a different thread. So have the worker thread post a GUI message when it is complete, the handler will then run in the main thread.

    In Windows, use PostMessage.

    In Linux, use XtAppAddSignal and XtNoticeSignal

提交回复
热议问题