hold on, immediate mode GUI code means you create logic trees that decide how to paint the display, as code, with branches and switches and if/then/whatever stuff
they have to be multithreaded, or at least the render thread needs to interrupt everything else the app is doing or you lose fps
the tricky thing is sometimes needing to do secondary processing in between painting, like with scrolling and physics and animations, these need to sometimes be computed before you do the paint or the variability of the time required to do the compute can impact your frame rate