frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Show HN: LocalGPT – A local-first AI assistant in Rust with persistent memory

https://github.com/localgpt-app/localgpt
202•yi_wang•7h ago•80 comments

DoNotNotify is now Open Source

https://donotnotify.com/opensource.html
14•awaaz•1h ago•3 comments

Haskell for all: Beyond agentic coding

https://haskellforall.com/2026/02/beyond-agentic-coding
95•RebelPotato•7h ago•27 comments

Roger Ebert Reviews "The Shawshank Redemption"

https://www.rogerebert.com/reviews/great-movie-the-shawshank-redemption-1994
21•monero-xmr•3h ago•8 comments

SectorC: A C Compiler in 512 bytes (2023)

https://xorvoid.com/sectorc.html
287•valyala•15h ago•55 comments

LLMs as the new high level language

https://federicopereiro.com/llm-high/
99•swah•4d ago•178 comments

Software factories and the agentic moment

https://factory.strongdm.ai/
224•mellosouls•17h ago•381 comments

The Architecture of Open Source Applications (Volume 1) Berkeley DB

https://aosabook.org/en/v1/bdb.html
23•grep_it•5d ago•3 comments

Speed up responses with fast mode

https://code.claude.com/docs/en/fast-mode
181•surprisetalk•14h ago•182 comments

Moroccan sardine prices to stabilise via new measures: officials

https://maghrebi.org/2026/01/27/moroccan-sardine-prices-to-stabilise-via-new-measures-officials/
6•mooreds•5d ago•0 comments

LineageOS 23.2

https://lineageos.org/Changelog-31/
37•pentagrama•3h ago•7 comments

Hoot: Scheme on WebAssembly

https://www.spritely.institute/hoot/
190•AlexeyBrin•20h ago•36 comments

Stories from 25 Years of Software Development

https://susam.net/twenty-five-years-of-computing.html
192•vinhnx•18h ago•19 comments

Brookhaven Lab's RHIC concludes 25-year run with final collisions

https://www.hpcwire.com/off-the-wire/brookhaven-labs-rhic-concludes-25-year-run-with-final-collis...
79•gnufx•13h ago•62 comments

Substack confirms data breach affects users’ email addresses and phone numbers

https://techcrunch.com/2026/02/05/substack-confirms-data-breach-affecting-email-addresses-and-pho...
55•witnessme•4h ago•14 comments

uLauncher

https://github.com/jrpie/launcher
20•dtj1123•4d ago•1 comments

Vocal Guide – belt sing without killing yourself

https://jesperordrup.github.io/vocal-guide/
353•jesperordrup•1d ago•104 comments

Wood Gas Vehicles: Firewood in the Fuel Tank (2010)

https://solar.lowtechmagazine.com/2010/01/wood-gas-vehicles-firewood-in-the-fuel-tank/
46•Rygian•2d ago•16 comments

First Proof

https://arxiv.org/abs/2602.05192
144•samasblack•17h ago•87 comments

Show HN: I saw this cool navigation reveal, so I made a simple HTML+CSS version

https://github.com/Momciloo/fun-with-clip-path
100•momciloo•15h ago•23 comments

Start all of your commands with a comma (2009)

https://rhodesmill.org/brandon/2009/commands-with-comma/
602•theblazehen•3d ago•218 comments

Al Lowe on model trains, funny deaths and working with Disney

https://spillhistorie.no/2026/02/06/interview-with-sierra-veteran-al-lowe/
113•thelok•17h ago•25 comments

The AI boom is causing shortages everywhere else

https://www.washingtonpost.com/technology/2026/02/07/ai-spending-economy-shortages/
336•1vuio0pswjnm7•21h ago•544 comments

The Scriptovision Super Micro Script video titler is almost a home computer

http://oldvcr.blogspot.com/2026/02/the-scriptovision-super-micro-script.html
10•todsacerdoti•6h ago•1 comments

Show HN: A luma dependent chroma compression algorithm (image compression)

https://www.bitsnbites.eu/a-spatial-domain-variable-block-size-luma-dependent-chroma-compression-...
43•mbitsnbites•3d ago•6 comments

OpenCiv3: Open-source, cross-platform reimagining of Civilization III

https://openciv3.org/
917•klaussilveira•1d ago•277 comments

Selection rather than prediction

https://voratiq.com/blog/selection-rather-than-prediction/
38•languid-photic•4d ago•20 comments

FDA intends to take action against non-FDA-approved GLP-1 drugs

https://www.fda.gov/news-events/press-announcements/fda-intends-take-action-against-non-fda-appro...
123•randycupertino•10h ago•250 comments

Where did all the starships go?

https://www.datawrapper.de/blog/science-fiction-decline
173•speckx•4d ago•259 comments

Show HN: Look Ma, No Linux: Shell, App Installer, Vi, Cc on ESP32-S3 / BreezyBox

https://github.com/valdanylchuk/breezydemo
308•isitcontent•1d ago•39 comments
Open in hackernews

The case of the UI thread that hung in a kernel call

https://devblogs.microsoft.com/oldnewthing/20250411-00/?p=111066
143•luu•9mo ago

Comments

simscitizen•9mo ago
Oh I've debugged this before. Native memory allocator had a scavenge function which suspended all other threads. Managed language runtime had a stop the world phase which suspended all mutator threads. They ran at about the same time and ended up suspending each other. To fix this you need to enforce some sort of hierarchy or mutual exclusion for suspension requests.

> Why you should never suspend a thread in your own process.

This sounds like a good general princple but suspending threads in your own process is kind of necessary for e.g. many GC algorithms. Now imagine multiple of those runtimes running in the same process.

hyperpape•9mo ago
> suspending threads in your own process is kind of necessary for e.g. many GC algorithms

I think this is typically done by having the compiler/runtime insert safepoints, which cooperatively yield at specified points to allow the GC to run without mutator threads being active. Done correctly, this shouldn't be subject to the problem the original post highlighted, because it doesn't rely on the OS's ability to suspend threads when they aren't expecting it.

achierius•9mo ago
This is a good approach but can be tricky. E.g. what if your thread spends a lot of time in a tight loop, e.g. doing a big inlined matmul kernel? Since you never hit a function call you don't get safepoints that way -- you can add them to the back-edge of every loop, but that can be a bit unappetizing from a performance perspective.
chipsa•9mo ago
If you don’t create any GC-able objects in the loop, why would you need to call the GC? And if you are, that should involve a function call.

And if you do need to call the GC, you could manually insert function calls every x loop iterations.

MarkSweep•9mo ago
> suspending threads in your own process is kind of necessary for e.g. many GC algorithms

True. Maybe the more precise rule is “only suspend threads for a short amount of time and don’t acquire any locks while doing it”?

The way the .NET runtime follows this rule is it only suspends threads for a very short time. After suspending, the thread is immediately resumed if it not running managed code (in a random native library or syscall). If the thread is running managed code, the thread is hijacked by replacing either the instruction pointer or the return address with a the address of a function that will wait for the GC to finish. The thread is then immediately resumed. See the details here:

https://github.com/dotnet/runtime/blob/main/docs/design/core...

> Now imagine multiple of those runtimes running in the same process.

Can that possibly reliably work? Sounds messy.

ot•9mo ago
On Linux you'd do this by sending a signal to the thread you want to analyze, and then the signal handler would take the stack trace and send it back to the watchdog.

The tricky part is ensuring that the signal handler code is async-signal-safe (which pretty much boils down to "ensure you're not acquiring any locks and be careful about reentrant code"), but at least that only has to be verified for a self-contained small function.

Is there anything similar to signals on Windows?

dblohm7•9mo ago
The closest thing is a special APC enqueued via QueueUserAPC2 [1], but that's relatively new functionality in user-mode.

[1] https://learn.microsoft.com/en-us/windows/win32/api/processt...

jvert•9mo ago
Or SetThreadContext() if you want to be hardcore. (not recommended)
manwe150•9mo ago
Why not recommended? As far as things close to signals go, this is how you implement signals in user land on Windows (along with pause/resume thread). You can even take locks later during the process, as long as you also took them before sending the signal (same exact restrictions as fork actually, but unfortunately atfork hooks are not accessible and often full of fork-unsafe data race and deadlock implementation bugs themselves in my experience with all the popular libc)
dblohm7•9mo ago
I’ve implemented them as you describe, but it’s still a bit hacky due to lots of corner cases — what if your target thread is currently executing in the kernel?

The special APC is nicer because the OS is then aware of what you’re doing— it will perform the user-mode stack changes while transitioning back to user-mode and handle cleanup once the APC queue is drained.

dwattttt•9mo ago
The 2 implies an older API, its predecessor QueueUserAPC has been around since the XP days.

The older API is less like signals and more like cooperative scheduling in that it waits for the target thread to be in an "alertable" state before it runs (the thread executes a sleep or a wait for something)

dblohm7•9mo ago
> The 2 implies an older API, its predecessor QueueUserAPC has been around since the XP days.

I wasn’t implying that APCs were new, I was implying that the ability to enqueue special (as opposed to normal) APCs from user-mode is new. And of course, that has always been possible from kernel-mode with NT.

zavec•9mo ago
I knew from seeing a title like that on microsoft.com that it was going to be a Raymond Chen post! He writes fascinating stuff.
eyelidlessness•9mo ago
I thought the same thing. It’s usually content that’s well outside my areas of familiarity, often even outside my areas of interest. But I usually find his writing interesting enough to read through anyway, and clear enough that I can usually follow it even without familiarity with the subject matter.
billforsternz•9mo ago
I had the same thought too. I wonder if this his role at Microsoft now? Kind of a human institutional knowledge repository, plus a kind of brand ambassador to the developer community, plus mentor to younger engineers, plus chronicler.

I hope he keeps going, no doubt he could choose to finish up whenever he wants to.

ryao•9mo ago
I had the same thought. I imagine the percentage of hacker news links to microsoft.com that are Raymond Chen links is high.
pitterpatter•9mo ago
Reminds me of a hang in the Settings UI that was because it would get stuck on an RPC call to some service.

Why was the service holding things up? Because it was waiting on acquiring a lock held by one of its other threads.

What was that other thread doing? It was deadlocked because it tried to recursively acquire an exclusive srwlock (exactly what the docs say will happen if you try).

Why was it even trying to reacquire said lock? Ultimately because of a buffer overrun that ended up overwriting some important structures.

rat87•9mo ago
Reminds me of a bug that would bluescreen windows if I stopped Visual Studio debugging if it was in the middle of calling the native Ping from C#
bob1029•9mo ago
I've been able to get managed code to BSOD my machine by simply having a lot of thread instances that are aggressively communicating with each other (i.e., via Channel<T>). It's probably more of a hardware thing than a software thing. My Spotify fails to keep the audio buffer filled when I've got it fully saturated. I feel like the kernel occasionally panics when something doesn't resolve fast enough with regard to threads across core complexes.
brcmthrowaway•9mo ago
Can this happen with Grand Central Dispatch ?
immibis•9mo ago
did... did you understand what the bug was?
saagarjha•9mo ago
This is a complicated question. If you "suspend" a GCD queue using the traditional APIs then it will happen between block execution, which is unlikely to cause problems, because people do not typically take locks between different items. But if you suspend the thread that backs the queue (using thread_suspend) you will definitely run into problems unless you're really careful.
markus_zhang•9mo ago
Although I understand nothing from these posts, read Raymond's posts somehow always "tranquil" my inner struggles.

Just curious, is this customer a game studio? I have never done any serious system programming but the gist feels like one.

ajkjk•9mo ago
I would guess it's something corporate. They can afford to pause the UI and ship debugging traces home more than a real-time game might.
delusional•9mo ago
Id actually expect a customer facing program more. Corporate software wouldn't care that the UI hung, you're getting paid to sit there and look at it.
tedunangst•9mo ago
The banker trying to close a deal isn't paid by the hour.
immibis•9mo ago
Unless the user's boss complained to the programmer's boss
skissane•9mo ago
> Corporate software wouldn't care that the UI hung, you're getting paid to sit there and look at it.

The article says the thread had been hung for 5 hours. And if you understand the root cause, once it entered into the hung state, then absent some rather dramatic intervention (e.g. manually resuming the suspended UI thread), it would remain hung indefinitely.

The proper solution, as Raymond Chen notes, is to move the monitoring thread into a separate process, that would avoid this deadlock.

saagarjha•9mo ago
Suspending threads is generally not that expensive, especially if you don't do it very often. Like, it's not free, and don't do it every frame, but even if it takes even a millisecond (wildly overestimated) that's fine if you don't do it very often. Even if you're hitting a 120 Hz deadline.
boxed•9mo ago
I had a support issue once at a well known and big US defense firm. We got kernel hangs consistently in kernel space from normal user-level code. Crazy shit. I opened a support issue which eventually got closed because we used an old compiler. Fun times.
saagarjha•9mo ago
An old compiler that was…miscompiling the kernel? It's hard to imagine any other situation that would be a valid reason to close the bug.
makz•9mo ago
Looking at the title, at first I thought “uh?”, but then I saw microsoft and it made sense.
frabona•9mo ago
Such a clean breakdown. "Don’t suspend your own threads" should be tattooed on every Windows dev’s arm at this point
baruchthescribe•9mo ago
>Naturally, a suspended UI thread is going to manifest itself as a hang.

The correct terminology is 'stopped responding' Raymond. You need to consult the style guide.

ryao•9mo ago
Who are these customers that get developer support from Microsoft engineering teams?
zoogeny•9mo ago
I worked on a team that did. We had a monthly call with a MS rep and access to devs working on the platform features we were working on (for MS Teams specifically). It is probably more common than you think.
tgv•9mo ago
I worked for a small shop that provided something MS couldn’t/wouldn’t, but which was essential for their international business anyway. So we too had engineering support.
qingcharles•9mo ago
It's expensive. Really expensive. I remember a major bank calling me and my buddy's 2-man consultancy team and telling me they had spent a small fortune on whatever the top-level access to MS developers is, to get some outdated MS COM component to interface with .NET, and MS had failed.

(We charged ~$20K and estimated two weeks. We had it working in two hours.)

Robin_Message•9mo ago
I gotta ask, did you spend a week sucking your teeth after that, or did you hand it to them and say "hey, you're paying for expertise and we got it to you faster than we estimated"?
orthoxerox•9mo ago
The correct way is the send the customer the almost-final version and wait for the bug report. This way you show how quickly you can tackle the problem but don't make the task look too easy.
mikaraento•9mo ago
I remember being able to file support cases just by buying one for a couple of hundred dollars. They'd also promise that if it turned out to be a bug in the product the fee would be refunded.

(My case wasn't solved. It was something about variable delays in getting packets off the network and into userspace but we never got to the bottom of it).

saagarjha•9mo ago
> If you want to suspend a thread and capture stacks from it, you’ll have to do it from another process, so that you don’t deadlock with the thread you suspended.

Unfortunately sometimes you don't have the luxury of being able to do this (e.g. on iOS, especially pre-MetricKit). We shipped one such implementation in the Twitter app (which was still there last I checked) and as far as I can tell it's safe but mostly by accident–I didn't want to to pause things for very long, so the code just suspends the thread, grabs register state, then writes the backtrace to a stack buffer before resuming. I originally wanted to grab traces without suspending the process, which is something you can actually "do" because getting register state doesn't require suspension and you need to put guards on your frame decoding anyway ("is this address I am about to dereference actually in the stack?"). But unfortunately after thinking about it I added the suspension back because trying to collect a trace from a running thread could give you a fragmented backtrace as it modifies it out from under you.

Permik•9mo ago
I have the weirdest hunch that the customer in question was Valve :D