Task Scheduling in UXP Hybrid Plugins

Howdy! After tinkering around with the UXP Hybrid Plugins C++ SDK I’m curious about how tasks are scheduled in UxpAddonApis.uxp_addon_schedule_on_main_queue. Specifically I’m wondering if this does proper pre-emptive multitasking or whether the main thread is fully used up with a task for the entirety of its execution and blocked from handling anything else? Based on the async example in the SDK I created an example with a long-running computation. It seems to block the main thread (with a turning wheel cursor showing) for the duration of the task (with the scripting thread staying responsive).

It’s a simple FIFO queue, and non pre-emptive in nature. So main thread will be blocked till task execution is completed. This is expected behavior, If you have any issues in implementation, Please provide more details on your usecase to schedule task on main_queue.