I am working on a device based on the ESP32 that will involve a running calculations that will take up to 2 seconds to complete, and at times will need to run every 5-10 seconds. Alongside this there will be a GUI (LVGL based) controlled by buttons that should be both responsive, and will also need to update frequently, along with other calculations and sensor reading.
Knowing that the ESP32 is dual core, a natural solution would be to run the long calculation on the second core, although I understand that this is not really an option, due to both micropython being locked to a single core, and the GIL mening that tasks wouldn't run truly in parallel. I have seen that the GIL is not implimented on the pico2040 port is this a choice, or a limitation of the chip?
Another option is to utilise asyncronous processess to run the main task slower but allow for others to run while it is taking place. I know this can be done using ascyn wait calls, but what its the best way to do this in an iterative process with lots of steps, should wait be called often and how long should they be?
Are there any other obvious (or less obvious) methods I am missing to handle user input alongside long running tasks?