0

So I am trying to get an idea of how browsers are internally implemented. The browser must poll the event queue for events, but I am wondering how frequently this is done or If there is some sort of pattern/known solution to go about this?

You clearly can't do

while(1) {
    //check the event queue for events 
}

B/c that would lock up the entire thread and the browser uses a single-threaded execution model in which it checks the event queue for any events, if there is an event in the event queue - then it executes it. (At least that's how I understand it)

2
  • 1
    Sockets are polled for events using poll(2) or select(2) or other similar method. Also see Event loop.
    – Dan D.
    Mar 13, 2014 at 4:54
  • @DanD. Thanks! Wish I had enough rep to upvote Mar 13, 2014 at 5:01

0

You must log in to answer this question.

Browse other questions tagged .