Alternative for Postmessage and sendmessage

后端 未结 5 1883
北荒
北荒 2021-01-31 00:46

i have a program which is using several threads to execute some task. Each thread is having a bunch of task to execute. after executing one of them, each thred will call a post

5条回答
  •  再見小時候
    2021-01-31 00:52

    I have done this many times. Have the posted message from the threads update a "cache" on the main form. Have a timer on the main form (set to around 100 ms, or less if you need to) update the main form from the cache. This way the amount of work done per posted message is very small, so the application will spend less time processing and your application will appear "responsive".

提交回复
热议问题