frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Inside Rust's std and parking_lot mutexes – who wins?

https://blog.cuongle.dev/p/inside-rusts-std-and-parking-lot-mutexes-who-win
40•signa11•4d ago

Comments

pizlonator•51m ago
Author of the original WTF::ParkingLot here (what rust’s parking_lot is based on).

I’m surprised that this only compared to std on one platform (Linux).

The main benefit of parking lot is that it makes locks very small, which then encourages the use of fine grained locking. For example, in JavaScriptCore (ParkingLot’s first customer), we stuff a 2-bit lock into every object header - so if there is ever a need to do some locking for internal VM reasons on any object we can do that without increasing the size of the object

kccqzy•16m ago
There was a giant super-long GitHub issue about improving Rust std mutexes a few years back. Prior to that issue Rust was using something much worse, pthread_mutex_t. It explained the main reason why the standard library could not just adopt parking_lot mutexes:

From https://github.com/rust-lang/rust/issues/93740

> One of the problems with replacing std's lock implementations by parking_lot is that parking_lot allocates memory for its global hash table. A Rust program can define its own custom allocator, and such a custom allocator will likely use the standard library's locks, creating a cyclic dependency problem where you can't allocate memory without locking, but you can't lock without first allocating the hash table.

> After some discussion, the consensus was to providing the locks as 'thinnest possible wrapper' around the native lock APIs as long as they are still small, efficient, and const constructible. This means SRW locks on Windows, and futex-based locks on Linux, some BSDs, and Wasm.

> This means that on platforms like Linux and Windows, the operating system will be responsible for managing the waiting queues of the locks, such that any kernel improvements and features like debugging facilities in this area are directly available for Rust programs.

adzm•9m ago
The original webkit blog post about parking lot mutex implementation is a great read https://webkit.org/blog/6161/locking-in-webkit/

SHA1-Hulud the Second Comming – Postman, Zapier, PostHog All Compromised via NPM

https://www.aikido.dev/blog/shai-hulud-strikes-again-hitting-zapier-ensdomains
121•birdculture•1h ago•29 comments

France threatens GrapheneOS with arrests / server seizure for refusing backdoors

https://grapheneos.social/@watchfulcitizen@goingdark.social/115605398547420414
72•nabakin•29m ago•11 comments

NSA and IETF, part 3: Dodging the issues at hand

https://blog.cr.yp.to/20251123-dodging.html
219•upofadown•5h ago•81 comments

Inside Rust's std and parking_lot mutexes – who wins?

https://blog.cuongle.dev/p/inside-rusts-std-and-parking-lot-mutexes-who-win
40•signa11•4d ago•3 comments

Chrome Jpegxl Issue Reopened

https://issues.chromium.org/issues/40168998
104•markdog12•4h ago•25 comments

Corvus Robotics (YC S18): Hiring Head of Mfg/Ops, Next Door to YC Mountain View

1•robot_jackie•8m ago

Show HN: Cynthia – Reliably play MIDI music files – MIT / Portable / Windows

https://www.blaizenterprises.com/cynthia.html
57•blaiz2025•3h ago•17 comments

Serflings is a remake of The Settlers 1

https://www.simpleguide.net/serflings.xhtml
78•doener•2d ago•21 comments

Shai-Hulud Returns: Over 300 NPM Packages Infected

https://helixguard.ai/blog/malicious-sha1hulud-2025-11-24
559•mrdosija•6h ago•438 comments

Fast Lua runtime written in Rust

https://astra.arkforge.net/
67•akagusu•3h ago•35 comments

We stopped roadmap work for a week and fixed bugs

https://lalitm.com/fixits-are-good-for-the-soul/
161•lalitmaganti•1d ago•249 comments

Britain is one of the richest countries. So why do children live in poverty?

https://www.cnn.com/2025/11/24/uk/britain-child-poverty-intl-scli
18•rawgabbit•16m ago•4 comments

Slicing Is All You Need: Towards a Universal One-Sided Distributed MatMul

https://arxiv.org/abs/2510.08874
68•matt_d•5d ago•5 comments

RuBee

https://computer.rip/2025-11-22-RuBee.html
301•Sniffnoy•14h ago•52 comments

Disney Lost Roger Rabbit

https://pluralistic.net/2025/11/18/im-not-bad/
375•leephillips•6d ago•175 comments

Japan's gamble to turn island of Hokkaido into global chip hub

https://www.bbc.com/news/articles/c8676qpxgnqo
219•1659447091•14h ago•362 comments

Historically Accurate Airport Dioramas by AV Pro Designs

https://www.core77.com/posts/138995/Historically-Accurate-Airport-Dioramas-by-AV-Pro-Designs
5•surprisetalk•3d ago•0 comments

µcad: New open source programming language that can generate 2D sketches and 3D

https://microcad.xyz/
339•todsacerdoti•20h ago•110 comments

Ask HN: Hearing aid wearers, what's hot?

290•pugworthy•14h ago•153 comments

Lambda Calculus – Animated Beta Reduction of Lambda Diagrams

https://cruzgodar.com/applets/lambda-calculus
119•perryprog•11h ago•8 comments

The Rust Performance Book (2020)

https://nnethercote.github.io/perf-book/
179•vinhnx•5d ago•25 comments

I built an faster Notion in Rust

https://imedadel.com/outcrop/
108•PaulHoule•4d ago•60 comments

Show HN: Virtual SLURM HPC cluster in a Docker Compose

https://github.com/exactlab/vhpc
26•ciclotrone•4d ago•5 comments

New magnetic component discovered in the Faraday effect

https://phys.org/news/2025-11-magnetic-component-faraday-effect-centuries.html
185•rbanffy•4d ago•67 comments

Building the largest known Kubernetes cluster, with 130k nodes

https://cloud.google.com/blog/products/containers-kubernetes/how-we-built-a-130000-node-gke-cluster/
67•TangerineDream•2d ago•52 comments

Show HN: Stun LLMs with thousands of invisible Unicode characters

https://gibberifier.com
165•wdpatti•14h ago•74 comments

Fran Sans – font inspired by San Francisco light rail displays

https://emilysneddon.com/fran-sans-essay
1055•ChrisArchitect•22h ago•130 comments

Ego, empathy, and humility at work

https://matthogg.fyi/a-unified-theory-of-ego-empathy-and-humility-at-work/
123•mrmatthogg•15h ago•40 comments

Set theory with types

https://lawrencecpaulson.github.io//2025/11/21/Typed_Set_Theory.html
94•baruchel•2d ago•15 comments

The Cloudflare outage might be a good thing

https://gist.github.com/jbreckmckye/32587f2907e473dd06d68b0362fb0048
215•radeeyate•14h ago•151 comments