Junior — Middle
What happens to animation if the main thread of the application is blocked and why does it continue to work or not stop?
sobes.tech AI
Answer from AI
If the main thread of the application is blocked, animations that depend on this thread usually stop or start to jerk because UI updates and event handling occur on it.
However, some animations can continue to work if they are implemented at the hardware acceleration level (for example, using Core Animation in iOS). Core Animation performs animations on a separate GPU thread, so even if the main thread is blocked, visual effects can continue to play smoothly.
Thus, animation continues to work if it is hardware accelerated and does not depend on code execution in the main thread. If the animation is implemented through code that runs on the main thread, then it will stop when the main thread is blocked.