frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Cactus, a work-stealing parallel recursion runtime for C

https://github.com/xtellect/cactus
2•enduku•1h ago

Comments

PaulHoule•1h ago
My first take on work-stealing is to be skeptical. Like I don't know your exact case, but other work-stealing systems I've seen are not good at resource utilization.

Also that parallel Fibonacci strikes me as a very bad example. Usually we use parallelism because we want to make something run faster: you can probably add 100,000 pairs of numbers for what a context switch costs so this certainly takes longer. More complicated, likely buggier, slower, what's to like about it?

You can get very consistent results with something that works like the Executor in Java if your task can be batched into something that takes longer to process than a context switch and you have a good heuristic to pick the thread count, usually there is a wide range over which you get decent performance, say 15-100, but so often I've seen work-stealing systems only use 2 or 3 threads when there are 16 cores available.

enduku•1h ago
Thanks for taking a look, really appreciate the thoughtful feedback! You're absolutely right about Fibonacci. It's a terrible performance example since the work per fork is basically zero :) I included it as an 8-line API showcase, and because it's almost pure overhead it doubles as a brutal stress test for the runtime. The nqueens, matmul, and quicksort benchmarks in the repo are the real performance indicators, imo. And yeah, batching and granularity control matter a lot, there's a section in the README on tuning the serial cutoff.

On the utilization and context switch concerns, i feel they typically stem from centralized queues or allocator contention in child-stealing systems (like TBB). Cactus uses continuation-stealing instead: on FORK, the child runs immediately as a normal function call, and the parent's continuation (just 24 bytes: RBP/RSP/return address) goes onto a per-worker deque.

If nobody steals it, the parent reclaims it at JOIN with an atomic decrement. No allocation, no stack switch, no context switch on the fast path. A stack switch only happens when a thief actually steals work and grabs a recycled slab from the pool.

The other scalability killer is usually lock-based synchronization at join points. I tried to avoid this by using atomic counters for the worker/thief handoff instead of mutexes. You can test scaling yourself: CACTUS_NPROCS=1 build/cc/nqueens 14 vs CACTUS_NPROCS=N build/cc/nqueens 14.

That said, I totally agree an Executor model is the right tool for flat workloads. I built this specifically for recursive divide-and-conquer (game trees, mergesort, mesh refinement) where you'd otherwise have to manually flatten the recursion or risk deadlocking a fixed-size pool.

SuperMicro sued by shareholders over China-related criminal case

https://finance.yahoo.com/markets/stocks/articles/super-micro-sued-shareholders-over-221915291.html
1•irishcoffee•1m ago•1 comments

GLP-1 Anti-Obesity Rx and Alcohol and Substance Use Disorders

https://www.psychologytoday.com/us/blog/addiction-outlook/202602/glp-1-anti-obesity-rx-and-alcoho...
1•PaulHoule•2m ago•0 comments

Android Sets New Record for Mobile Web Performance

https://blog.chromium.org/2026/03/android-sets-new-record-for-mobile-web.html
2•WalterSobchak•2m ago•0 comments

Clojure: The Documentary, official trailer [video]

https://www.youtube.com/watch?v=JJEyffSdBsk
1•fogus•3m ago•0 comments

Leadership – Bold Visionary, Technocratic Expert, or Trimmer

https://www.theatlantic.com/ideas/2026/03/make-better-decisions-trimmer/686522/
2•bell-cot•3m ago•1 comments

Helix – Self-healing SDK for AI agent payments

https://github.com/adrianhihi/helix
1•adrianhihi•5m ago•0 comments

Harvey Raises at $11B Valuation

https://www.harvey.ai/blog/harvey-raises-at-dollar11-billion-valuation-to-scale-agents-across-law...
1•skogstokig•5m ago•0 comments

Non-Hype Manifesto of 90s CS Graduates

https://www.ResTechAI.com/manifesto
2•rtaic-coder•5m ago•0 comments

Fedora 45 Aims for IPv6-Mostly Support Out-of-the-Box

https://www.phoronix.com/news/Fedora-45-IPv6-Mostly
1•speckx•5m ago•0 comments

Will software engineers survive agentic AI?

https://www.ft.com/content/7325e967-5f4e-40b1-af3f-7d2351781843
1•nprateem•8m ago•0 comments

Embedding Models to Choose in 2026: 10 Models Benchmarked

https://milvus.io/blog/choose-embedding-model-rag-2026.md
1•Fendy•8m ago•1 comments

Using Haskell as My Shell (2021)

https://web.archive.org/web/20230610073408/https://las.rs/blog/haskell-as-shell.html
1•aragonite•9m ago•0 comments

OpenAI just killed Sora as company readies new 'Spud' model and IPO

https://www.tomsguide.com/ai/openai-just-killed-sora-as-company-readies-ipo-and-new-spud-model
1•reconnecting•10m ago•0 comments

Exploiting AQL Injection Vulnerabilities in ArangoDB

https://www.anvilsecure.com/blog/exploiting-aql-injection-vulnerabilities-in-arangodb.html
2•anvilsecure•13m ago•0 comments

As US Midterms Approach, AI Is Going to Emerge as a Key Issue Concerning Voters

https://www.schneier.com/blog/archives/2026/03/as-the-us-midterms-approach-ai-is-going-to-emerge-...
3•speckx•15m ago•0 comments

Linux kernel czar says AI bug reports aren't slop anymore

https://www.theregister.com/2026/03/26/greg_kroahhartman_ai_kernel/
4•Philpax•15m ago•0 comments

Improving Composer through real-time RL

https://cursor.com/blog/real-time-rl-for-composer
3•ingve•15m ago•0 comments

Show HN: Lexe – Self-Custodial Lightning Nodes in TEEs, Python and Rust SDKs

https://blog.lexe.app/public-launch/
3•phlip9•16m ago•1 comments

Routing vs. trust in multi-agent systems

https://www.godaddy.com/resources/news/intelligent-ai-routing
2•tmuhlestein•16m ago•0 comments

Show HN: Vizier – A physical design advisor for DuckDB

3•habedi0•17m ago•0 comments

OTEL/EDOT AutoPilot – OpenTelemetry for all languages (skills and MD files)h

https://github.com/gmoskovicz/edot-autopilot
2•gmoskovicz•18m ago•1 comments

Damaged church floor may have revealed the grave of the fourth musketeer

https://arstechnica.com/science/2026/03/archaeologists-may-have-found-the-grave-of-the-legendary-...
2•Khaine•20m ago•0 comments

Trust Signals as Sparklines for Hacker News

https://hn-trustspark.com/
2•solaire_oa•20m ago•0 comments

Google Analytics MCP for Claude

https://github.com/googleanalytics/google-analytics-mcp
3•crog•22m ago•0 comments

Church attendance report pulled after YouGov finds 'fraudulent' responses

https://www.bbc.com/news/articles/cpwjxx5eyn1o
2•dijksterhuis•22m ago•1 comments

You're Not Getting Promoted Because You're Doing Your Job

https://www.pathtostaff.com/p/youre-not-getting-promoted-because
4•sidwyn•22m ago•0 comments

Create a Dedicated Focus Nook

https://practicalbetterments.com/create-a-dedicated-focus-nook/
2•DitheringIdiot•24m ago•0 comments

Review of "Vibe Coding: Building production grade software with Gen AI"

https://www.pramodb.com/index.php/2026/03/26/book-review-vibe-coding-building-production-grade-so...
2•pramodbiligiri•24m ago•0 comments

Cohere launches an open source voice model specifically for transcription

https://techcrunch.com/2026/03/26/cohere-launches-an-open-source-voice-model-specifically-for-tra...
2•newusertoday•25m ago•0 comments

Show HN: Grandma Knows – conversational web analytics

https://grandmaknows.com/
2•sergeigolubev•28m ago•1 comments