frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

The Scalar Select Anti-Pattern

https://matklad.github.io/2025/05/14/scalar-select-aniti-pattern.html
47•goranmoomin•7mo ago

Comments

castratikron•7mo ago
As long as processing one event does not affect any of the other events in the batch. E.g. events are file IO, and processing one event causes another event's descriptor to get closed before that event can be processed.
wahern•7mo ago
If the close routine on an event source, or the low-level (e.g. epoll) registration, deregistration, and dequeueing logic doesn't know how to keep polling and liveness state consistent between userspace and the kernel, they've got much bigger problems. This looks like Rust code so I would hope the event stream libraries are, e.g., keeping Rc'd file objects and properly managing reference integrity viz-a-viz kernel state before the application caller ever sees the first dequeued event in a cycle. This is a perennial issue with event loop libraries and buggy application code (in every language). One can't just deal with raw file descriptors, call the close syscall directly, etc, hoping to keep state consistent implicitly. There's an unavoidable tie-in needed between application's wrappers around low-level resources and the event loop in use.
taeric•7mo ago
I'm not entirely clear on what the proposal is at the end? Seems that the long term answer as to "which of these implications to pursue" is "all of them?" Simply taking in a batch of instructions doesn't immediately change much? You still have to be able to do each of the other things. And you will still expect some dependencies between batches that could possibly interact in the same ways.

In a sense, this is no different than how your processor is dealing with instructions coming in. You will have some instructions that can be run without waiting on previous ones. You will have some that can complete quickly. You will have some that are stalled on other parts of the system. (I'm sure I could keep wording an instruction to match each of the implications.)

To that end, part of your program has to deal with taking off "whats next" and finding how to prepare that to pass to the execution portion of your program. You can make that only take in batches, but you are almost certainly responsible for how you chunk them moreso than whatever process is sending the instructions to you? Even if you are handed clear batches, it is incumbent on you to batch them as they go off to the rest of the system.

lmz•7mo ago
I guess the proposal is "instead of fetching and acting on one event at a time, consider fetching all available events and look for opportunities to optimize which ones you process (e.g. by prioritization or by skipping certain events if superseded by newer ones)".
taeric•7mo ago
I mean, I got that. But you could as easily say "instead of fetching and acting on one event at a time, fetch and triage/route instructions into applicable queues."

In particular, there is no guarantee that moving to batches changes any of the problems you may have from acting on a single one at a time. To that end, you will have to look into all of the other strategies sooner or later.

Following from that, the problem is not "processMessage" or whatever. The problem is that you haven't broken "processMessage" up into the constituent "receive/triage/process/resolve" loop that you almost certainly will have to end up with.

malkia•7mo ago
in CPU's - pipelining!
jchw•7mo ago
I believe something similar is going on internally in Windows with event queues. It coalesces and prioritizes input events when multiple of them pile up before you're able to pop new events off of the queue. (For some events, e.g. pointer events, you can even go and query frames that were coalesced during input handling.) On the application/API end, it just looks like a "scalar select" loop, but actually it is doing batching behavior for input events!

(On the flip side, if you have a Wayland client that falls behind on processing its event queue, it can crash. On the whole this isn't really that bad but if you have something sending a shit load of events it can cause very bad behavior. This has made me wonder if it's possible, with UNIX domain sockets, to implement some kind of event coalescing on the server-side, to avoid flooding the client with high-precision pointer movement events while it's falling behind. Maybe start coalescing when FIONREAD gets to some high watermark? No idea...)

Flock and Cyble Inc. Weaponize "Cybercrime" Takedowns to Silence Critics

https://haveibeenflocked.com/news/cyble-downtime
353•_a9•6h ago•65 comments

Show HN: Jmail – Google Suite for Epstein files

https://www.jmail.world
637•lukeigel•10h ago•128 comments

Backing Up Spotify

https://annas-archive.li/blog/backing-up-spotify.html
1081•vitplister•13h ago•363 comments

Measuring AI Ability to Complete Long Tasks: Opus 4.5 has 50% horizon of 4h49M

https://metr.org/blog/2025-03-19-measuring-ai-ability-to-complete-long-tasks/
98•spicypete•3h ago•69 comments

Ireland’s Diarmuid Early wins world Microsoft Excel title

https://www.bbc.com/news/articles/cj4qzgvxxgvo
222•1659447091•11h ago•77 comments

Claude in Chrome

https://claude.com/chrome
178•ianrahman•10h ago•86 comments

Pure Silicon Demo Coding: No CPU, No Memory, Just 4k Gates

https://www.a1k0n.net/2025/12/19/tiny-tapeout-demo.html
330•a1k0n•15h ago•48 comments

Indoor Tanning Makes Youthful Skin Much Older on a Genetic Level

https://www.ucsf.edu/news/2025/12/431206/indoor-tanning-makes-youthful-skin-much-older-genetic-level
12•SanjayMehta•2h ago•2 comments

Log level 'error' should mean that something needs to be fixed

https://utcc.utoronto.ca/~cks/space/blog/programming/ErrorsShouldRequireFixing
363•todsacerdoti•3d ago•229 comments

Big GPUs don't need big PCs

https://www.jeffgeerling.com/blog/2025/big-gpus-dont-need-big-pcs
187•mikece•13h ago•61 comments

Go ahead, self-host Postgres

https://pierce.dev/notes/go-ahead-self-host-postgres#user-content-fn-1
486•pavel_lishin•16h ago•302 comments

From devastation to wonder as Kangaroo Island bushfires lead to cave discoveries

https://www.abc.net.au/news/2025-12-13/more-than-150-caves-discovered-in-ki-after-devastating-bus...
43•speckx•5d ago•6 comments

Chomsky and the Two Cultures of Statistical Learning

https://norvig.com/chomsky.html
48•atomicnature•4d ago•27 comments

Isengard in Oxford

https://lareviewofbooks.org/article/isengard-in-oxford/
5•lermontov•2h ago•0 comments

What's New in Python 3.15

https://docs.python.org/3.15/whatsnew/3.15.html
44•azhenley•3d ago•4 comments

Italian bears living near villages have evolved to be smaller and less agressive

https://phys.org/news/2025-12-italian-villages-evolved-smaller-aggressive.html
81•wjSgoWPm5bWAhXB•5d ago•43 comments

Gemini 3 Pro vs. 2.5 Pro in Pokemon Crystal

https://blog.jcz.dev/gemini-3-pro-vs-25-pro-in-pokemon-crystal
271•alphabetting•4d ago•82 comments

I spent a week without IPv4 (2023)

https://www.apalrd.net/posts/2023/network_ipv6/
136•mahirsaid•13h ago•233 comments

Show HN: HN Wrapped 2025 - an LLM reviews your year on HN

https://hn-wrapped.kadoa.com?year=2025
177•hubraumhugo•18h ago•97 comments

Waymo halts service during S.F. blackout after causing traffic jams

https://missionlocal.org/2025/12/sf-waymo-halts-service-blackout/
50•rwoll•2h ago•34 comments

OpenSCAD is kinda neat

https://nuxx.net/blog/2025/12/20/openscad-is-kinda-neat/
232•c0nsumer•14h ago•166 comments

Biscuit is a specialized PostgreSQL index for fast pattern matching LIKE queries

https://github.com/CrystallineCore/Biscuit
99•eatonphil•4d ago•14 comments

Make the Eyes Go Away

https://hexeditreality.com/posts/make-the-eyes-go-away/
3•llllm•3d ago•0 comments

You have reached the end of the internet (2006)

https://hmpg.net/
142•raytopia•14h ago•36 comments

MIRA – An open-source persistent AI entity with memory

https://github.com/taylorsatula/mira-OSS
96•taylorsatula•10h ago•41 comments

Why do people leave comments on OpenBenches?

https://shkspr.mobi/blog/2025/12/why-do-people-leave-comments-on-openbenches/
137•sedboyz•15h ago•13 comments

Show HN: ZXC – Asymmetric, +40% decode vs. LZ4 on ARM (C, BSD-3, Fuzzed)

https://github.com/hellobertrand/zxc
12•pollop_•3d ago•3 comments

PG&E outages in S.F. leave 130k without electricity

https://www.sfchronicle.com/sf/article/pg-e-outage-40-000-customers-without-power-21254326.php
56•hamandcheese•4h ago•32 comments

Skills Officially Comes to Codex

https://developers.openai.com/codex/skills/
270•rochansinha•23h ago•123 comments

Depot (YC W23) Is Hiring an Enterprise Support Engineer (Remote/US)

https://www.ycombinator.com/companies/depot/jobs/jhGxVjO-enterprise-support-engineer
1•jacobwg•13h ago