title: How a runloop actually works
body: <p>Earlier this month I asked this question <a href="https://stackoverflow.com/questions/4947556/what-is-a-runloop">'What is a runloop?'</a> After reading the answers and did some tries I got it to work, but still I do not understand it completely. If a runloop is just an loop that is associated with an thread and it don't spawn another thread behind the scenes how can any of the other code in my thread(mainthread to keep it simple) execute without getting "blocked"/not run because it somewhere make an infinite loop?</p>
  
  <p>That was question number one. Then over to my second.</p>
  
  <p>If I got something right about this after having worked with this, but not completely understood it a runloop is a loop where you attach 'flags' that notify the runloop that when it comes to the point where the flag is, it "stops" and execute whatever handler that is attached at that point? Then afterwards it keep running to the next in que.</p>
  
  <p><img src="https://i.stack.imgur.com/bjbCf.png" alt="runloop"></p>
  
  <p>So in this case no events is placed in que in connections, but when it comes to events it take whatever action associated with tap 1 and execute it before it runs to connections again and so on. Or am I as far as I can be from understanding the concept?</p>