Remembering a university lecture

Prof: "What are some other downsides of using polling instead of interrupts?"

Student: "The process has to wait until it gets polled."

Prof: "Exactly. When you click Ctrl+W, you want that tab to be closed immediately. You don't want the system to wait a few seconds for those keys to get polled and risk your mom looking at that tab."

  • 10
    Fun fact: because the browser tab runs on an event loop, ^W is actually polled, although not directly - it's resolved into an event object in a queue which is then polled.
  • 2
    Although I suppose the task queue supports both polled and signal based operation, when the queue is empty the page goes to sleep and when the first element is pushed the queue wakes it up.
  • 2
    This is probably a Joke/Meme, but it's a story so I'll allow it. Plus me caés bien.
  • 2
    @TheCommoner282 If ^W just closed the tab you would be right, but there is actually a JS event about closing the page, and the page even gets to contest it with an "Are you sure" popup.
  • 3

    Ugh, Ctrl W not being forced close irritates me.

    Especially because of so many shitty sites with their 'waaaah don't close meeeee' popups.
  • 1
    @CoreFusionX It has been useful to me in the past, but usually it's pretty pointless, I agree.
Add Comment