Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
lorentz1202439dFun 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.
-
lorentz1202439dAlthough 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.
-
c3r38r170336139dThis is probably a Joke/Meme, but it's a story so I'll allow it. Plus me caés bien.
-
@lorentz
I am not sure you're right.
The website runs on an event loop. At least its javascript does.
The browser stands before that. So, when you hit CTRL+W, the browser will check if it's a shortcut that it knows. Failling to find a meaning it will create a javascript event and hand it off to javascript's event loop.
But the browser if finding meaning in closing the tab. So it just closes the tab.
The browser itself shouldn't be running on an event loop. It knows true concurrency. I mean, there was a time in which browsers tried to be faster by opening multiple parallel sockets and those must be handled in threats.
I know very little about how any browser is built, but I do not see why they would go back to event loops when they are in a language with threats.
I mean I could imagine that there is an equivalent of kill -9 for tabs. Then you would be right. -
lorentz1202439d@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.
-
CoreFusionX107238d@lorentz
Ugh, Ctrl W not being forced close irritates me.
Especially because of so many shitty sites with their 'waaaah don't close meeeee' popups. -
lorentz1202438d@CoreFusionX It has been useful to me in the past, but usually it's pretty pointless, I agree.
Related Rants
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."
rant
professor
polling
interrupt
tab
os