Top all-time · #367
Preshing on Programming
Personal blog · preshing.comprogrammingsystems
Preshing on Programming is a personal blog at preshing.com about programming and systems. Since 2011, 147 different Hacker News readers have linked it 213 times, most often “An Introduction to Lock-Free Programming (2012)”. The last post was in 2021, but the archive is still widely read.
Sometimes recommended · 6 of 40 sampled comments recommend it?
Why HN links it
HN readers cite it mostly for memory ordering and memory models, lock-free programming, and hash collision probabilities, and recommend it as a low-level programming blog.
- Recommended for · 6 comments
- Called a good post on memory models and a short overview; introduces lock-free basics with pictures; solid bits.
Summarised by Claude from a sample of 40 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
C is a simple language. You’re only allowed to have one function with each name. C++, on the other hand, gives you much more flexibility: You can have multiple functions …
Most-linked posts?
- An Introduction to Lock-Free Programming (2012)8 people · 8 mentions · first linked 2019-01-30
- Hash Collision Probabilities (2011)7 people · 7 mentions · first linked 2014-08-25
- A Look Back At Single-Threaded CPU Performance (2012)6 people · 7 mentions · first linked 2014-03-31
- C++ Has Become More Pythonic (2014)6 people · 6 mentions · first linked 2014-12-02
- Weak vs. Strong Memory Models (2012)5 people · 9 mentions · first linked 2019-09-07
- This Hash Table Is Faster Than a Judy Array5 people · 5 mentions · first linked 2014-01-15
- Leapfrog Probing for open addressing hash tables4 people · 4 mentions · first linked 2016-03-14
- Memory Reordering Caught in the Act (2012)4 people · 4 mentions · first linked 2019-03-02
- A Flexible Reflection System in C++: Part 14 people · 4 mentions · first linked 2018-01-16
- Xkcd Password Generator4 people · 4 mentions · first linked 2015-04-09
What Hacker News says?
It's definitely true. Technical change in the 60s was enormous. During that period there was a lot of fundamental architectural change and experimentation; that's when they settled on 8-bit bytes as the standard, as well as many other things. Moore' Law became a thing. In the 70s is when we started seeing operating systems that look familiar to us, and even into the 80s it was plausible to introduce a new OS from sc…
Comment linking /20120208/a-look-back-at-single-threaded-cpu-performance/
on “Chess.com stopped working on 32bit iPads because 2^31 games have been played”Submitted Xkcd Password Generator as a story · 347 points
HN discussionBy design, the chance of a previous nonce being re-usable are virtually nill. http://preshing.com/20110504/hash-collision-probabilities/ The Bitcoin "nonce" is actually a much bigger number than shown in the video. 32 bits I believe.
Comment linking /20110504/hash-collision-probabilities/
on “Blockchain Demo [video]”Submitted How C++ Resolves a Function Call as a story · 299 points
HN discussionYou might be being really subtle about python there ! I realize that one can create lines of code like :_ = ( 255, lambda V ,B,c :c and Y(V V+B,B, c -1)if(abs(V)<6)else ( 2+c-4 abs(V) -0.4)/i ) ;v, x=1500,1000;C=range(v x );import struct;P=struct.pack;M,\ j ='<QIIHHHH',open('M.bmp','wb').write for X in j('BM'+P(M,v x 3+26,26,12,v,x,1,24))or C: i ,Y=_;j(P('BBB', (lambda T:(T 80+T 9 i-950 T 99,T 70-880 T 18+701 T 9 ,T…
Comment linking /20110926/high-resolution-mandelbrot-in-obfuscated-python/
on “This AI Boom Will Also Bust”Submitted This Is Why They Call It a Weakly-Ordered CPU as a story · 239 points
HN discussionFor low-level software, these are great: https://eli.thegreenplace.net/ https://travisdowns.github.io/ https://preshing.com/
Comment linking /
on “Ask HN: What are good solo developer blogs that you enjoy reading?”Submitted Plywood: A New Cross-Platform Open Source C++ Framework as a story · 196 points
HN discussionWe will not go down this path since everything is highly debatable but here is an article: https://preshing.com/20141202/cpp-has-become-more-pythonic/ It even states: C++ added tuples to the standard library in C++11. The proposal even mentions Python as an inspiration .
Comment linking /20141202/cpp-has-become-more-pythonic/
on “Cppfront, Herb Sutter's proposal for a new C++ syntax”Submitted An Introduction to Lock-Free Programming (2012) as a story · 149 points
HN discussionFor High Throughput compute, and cache correctness. Here are the primers I can give. None of these are required. Strong langauge, cs, interpersonal skills, team inter-interoperability, and commitment to quality (via unit and integration testing, and skill working with liners) can get you a lot further. The resources I'm linking are supplementary to the above, and you'll likely encounter them in the wild. But they'll…
Comment linking /20120913/acquire-and-release-semantics/
on “Ask HN: What should a systems/low-level software engineer know?”Submitted What Is a Bitcoin, Really? as a story · 145 points
HN discussionSomething like this[0], maybe? [0] http://preshing.com/20110811/xkcd-password-generator/
Comment linking /20110811/xkcd-password-generator/
on “LastPass Security Notice”Submitted Memory Reordering Caught in the Act as a story · 137 points
HN discussionPeople tend to confuse the odds of two arbitrary strings colliding with the chances of a set of strings having a collision. 32bit space is not that big, and you have to take into account the birthday problem. If you do out the math it turns out there's a 50% chance of collision after only 77,163 hashes. http://preshing.com/20110504/hash-collision-probabilities/
Comment linking /20110504/hash-collision-probabilities/
on “Get your own USB PID”Submitted An Introduction to Lock-Free Programming as a story · 128 points
HN discussionLest we forget, ARM has problems with instruction ordering not happening the way programmers might assume in certain cases. https://preshing.com/20121019/this-is-why-they-call-it-a-wea... https://news.ycombinator.com/item?id=4673458
Comment linking /20121019/this-is-why-they-call-it-a-weakly-ordered-cpu
on “Linus Torvalds on Why ARM Won't Win the Server Space”Submitted C++ Has Become More Pythonic (2014) as a story · 126 points
HN discussionFor a short overview read: > http://preshing.com/20120930/weak-vs-strong-memory-models/ If you want more details of memory models of some CPU architectures, read > http://www.rdrop.com/users/paulmck/scalability/paper/whymb.2... Note that "x86 OOStore" is not a model that you should be concerned about (according to https://groups.google.com/forum/#!topic/linux.kernel/2dBrSeI... it was only used on IDT WinChip) For a…
Comment linking /20120930/weak-vs-strong-memory-models/
on “Windows 10 on ARM”Submitted A resizable concurrent map as a story · 108 points
HN discussionStrength of memory model refers to concurrency guarantees. Also gets deep into caching architectures, OOO, and inter-cpu communications. This is a deep rabbit hole because modern processors are speculatively executing THOUSANDS of instructions ahead. So what you have/haven't written to memory is slightly existential. Here is a good blog post about it http://preshing.com/20120930/weak-vs-strong-memory-models/ The TLD…
Comment linking /20120930/weak-vs-strong-memory-models/
on “Windows 10 on ARM”Submitted High-Resolution Mandelbrot in Obfuscated Python as a story · 105 points
HN discussionGiven that people have asked why not use a statically typed language, seems appropriate to mention that it's possible to write pythonic-looking C++: http://preshing.com/20141202/cpp-has-become-more-pythonic/ I have been using C++ a lot lately but really wish there were more tools for reflection at compile time, e.g., ability to iterate over all the members of a class. Other than that, I'm really loving C++17's auto…
Comment linking /20141202/cpp-has-become-more-pythonic/
on “Open-sourcing MonkeyType – Let your Python code type-hint itself”Submitted 1MB Sorting Explained as a story · 96 points
HN discussionYour math is off a bit[0][1] but you're right, it's a vanishingly small probability of a single collision. This is fairly academic though, when you're talking about an adversary exploiting weaknesses in the algorithm itself, and not a perfect PRF. [0] http://preshing.com/20110504/hash-collision-probabilities/ [1] http://www.wolframalpha.com/input/?i=%281+billion+*+7+billio...
Comment linking /20110504/hash-collision-probabilities/
on “Why Google is Hurrying the Web to Kill SHA-1”Submitted Semaphores are surprisingly versatile as a story · 89 points
HN discussionI'm actually surprised no one mentioned these two Eli Bendersky http://eli.thegreenplace.net/ Jeff Preshing http://preshing.com/
Comment linking /
on “Ask HN: What programming blogs do you follow?”Submitted High-Resolution Mandelbrot in Obfuscated Python as a story · 86 points
HN discussionWell let's look at how this actually played out. - Defendant was in fact sending CP through his gmail. - gmail correctly detects and flags it based on hash value - Google sends message to NCMEC based on hash value - NCMEC sends it to police based on hash value Now police are facing the obvious question, is this actually CP? They open the image, determine it is, then get a warrant to search his gmail account, and (la…
Comment linking /20110504/hash-collision-probabilities/
on “Google’s TOS doesn’t eliminate a user’s Fourth Amendment rights, judge rules [pdf]”Submitted An Introduction to Lock-Free Programming (2012) as a story · 83 points
HN discussion