RunLoop
is a looping mechanism. It is a kind of infinite loop.
Thread
is a conceptual model of code execution(thread). Not directly related with loops or function calls. It denote flow of code. Internally, each thread has separate stack frame.
There exists the main thread (one and only one). By default, the main thread execute the main runloop.
The main runloop primarily handles keyboard and mouse input. Waiting infinitely for input events and calls appropriate event handlers.
One can create another thread and another runloop for background processing of not UI related events such as async socket, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With