boost::asio, threads and synchronization

前端 未结 4 1576
悲哀的现实
悲哀的现实 2021-02-05 21:58

This is somewhat related to this question, but I think I need to know a little bit more. I\'ve been trying to get my head around how to do this for a few days (whilst working o

4条回答
  •  攒了一身酷
    2021-02-05 22:16

    When data is received, how do people get the data back to the UI thread? In the past when I used completion ports, I made a special event that could post the data back to the main UI thread using a ::SendMessage. It wasn't elegant, but it worked

    ::PostMessage may be more appropriate.

    Unless everything runs in one thread these mechanisms must be used to safely post events to the UI thread.

提交回复
热议问题