开发者

Change Thread Priority of Async Event

开发者 https://www.devze.com 2023-03-06 02:11 出处:网络
I\'m hooked into the win32 low level mouse hook events and I would like to make that mouse click proc a 开发者_JAVA技巧higher thread priority so I can process mouse events while the UI thread is busy.

I'm hooked into the win32 low level mouse hook events and I would like to make that mouse click proc a 开发者_JAVA技巧higher thread priority so I can process mouse events while the UI thread is busy. Is this possible?


If you have a long running process this should be run on its own thread independent of the UI thread. This should take care of your problem and restore the UIs responsiveness

Also, I think you're confusing terms, Threads are independent execution paths (a sort of sub process) bound to a main process (your running application). Clicks generate events which occur on the UI thread and are queued in the order they occurred. As far as I know, this order can not be changed (at least not easily).


You can also implement async await to prevent background work from blocking the ui logic execution.

0

精彩评论

暂无评论...
验证码 换一张
取 消