In my experience with web browsers, you can't do this because Javascript can NEVER block. For example, if a function takes too long to run, it blocks rendering of the page. If there were ways to make Javascript asynchronously, browsers would have implemented it already, so I assume they can't do it without potential backward incompatibility.
One exception is alert(), which blocks and shows a dialog. But I don't think I've ever seen a website use it instead of showing a "normal" popup with CSS. It looks ugly so it's only used to debug that code actually runs.
I'm not knowledgeable about low-level interruptions, but I think you would need at least some runtime code to implement blocking the thread. In any case, even if the language provides this, you can't use it because the main thread is normally a GUI thread that can't respond to user interaction if it's blocked by another thread. That's the main point of using (background) threads in the first place: so the main thread never blocks from IO bottlenecks.
If it's sold to Opera I'll stop using it. Old Opera was good, and the people who made it are now making Vivaldi. New Opera promotes cryptocurrencies. :-(
DuckDuckGo has a web browser. Brave has a search engine. Kagi has a web browser.
It seems weird to single Google for this. Wasn't the core issue behind this that these other search engines couldn't compete with Google?
Vivaldi is a much better browser than their Chromium re-skins. Perhaps if their browsers were better people would use them instead of using Chrome. Additionally, perhaps if their search was better than Google, they would use it as well!
Google shoves AI overviews in your face now, and if that sucks, the only reasonable alternative is to use Bing currently. I can't use Brave's search or Mojeek. Brave ignores underscores. Mojeek doesn't even have a business model so it stops anyone from actually using it as a search engine. Yandex is full of results in Russian.
I wish someone would tell me what is this fabled competitor to Google that would benefit from crippling Google because so far I haven't been able to find one. I'd say the only engines better than Google are Wiby and Kiddle, because they focus on a specific niche instead of trying to compete on general web search.
Interesting, when I was taking a look at alternative search engines I tried Mojeek and I never saw a single ad, so I assumed it had no way to make money (just like Wiby).
But where are the ads?
I just searched for "best cars 2024." Not a single ad. "Insurance lawyers," no ads. "Best keyboard," no ads.
Maybe the reason why this happens is because I'm not from the US/EU/UK?
Also when I use a search operator, like "insurance lawyers" surrounded by double quotes, I get a 403 forbidden error because I appear "to be sending automated queries so we can't process your search at this time." To me, that means Mojeek won't let me use it as a search engine.
I'm pretty sure most languages just make the reasonable assumption that you want to map to the object so it uses the pointer for hashing and not actually hash its value.
One exception is alert(), which blocks and shows a dialog. But I don't think I've ever seen a website use it instead of showing a "normal" popup with CSS. It looks ugly so it's only used to debug that code actually runs.
I'm not knowledgeable about low-level interruptions, but I think you would need at least some runtime code to implement blocking the thread. In any case, even if the language provides this, you can't use it because the main thread is normally a GUI thread that can't respond to user interaction if it's blocked by another thread. That's the main point of using (background) threads in the first place: so the main thread never blocks from IO bottlenecks.