Does it matter if a multithread blocks for too long?

Important: unclear posts may not receive useful answers.

Description

I created a tcp server thread for waiting for the reload page signal, after receiving the signal to delete the specified component and reload part of the component, it will take at least 30s to process, according to this link said to add the mutual exclusion lock, the lv_tick_inc function is set to a fixed value, if the blocking too long more than the set period will there be any effect?

What MCU/Processor/Board and compiler are you using?

RV1126

What LVGL version are you using?

8.3

What do you want to achieve?

Multi-threaded refresh

Code to reproduce

main.c
    while (!quit) {
        lv_tick_inc(LVGL_TICK);
        lvgl_lock();
        lv_task_handler();
        lvgl_unlock();
        usleep(LVGL_TICK * 1000);
    }

reload.c
      lvgl_lock();
      reload(canvasPageMain);//May block for more than 30s
      lvgl_unlock();

lv_tick_inc should not be placed in the same thread as lv_task_handler, which will lead to inaccurate timing. For details, please refer to Tick interface — LVGL documentation.

1 Like