G
Geocar
geocar.sdf1.org · Personal blog · on HN since 2009
Geocar writes technical posts and code on fast servers, memory allocation, floating-point quirks and early asynchronous JavaScript.
What HN saysCommenters link his Fast Servers post as a relevant reference, and one agrees with a critique of pthreads.
15HN people shared it
2linked it in comments
17stories submitted
881story points
8 months agolast shared
2009people per year2026
Most-shared posts
- 1Fast Servers8 people · 160 points · first shared 2015 · 53 comments on HN
- 29999999999999999.0 – 9999999999999998.03 people · 446 points · first shared 2016 · 260 comments on HN
- 3How to allocate memory3 people · 267 points · first shared 2016 · 45 comments on HN
- 4Asynchronous JavaScript in 19953 people · 6 points · first shared 2016 · 1 comments on HN
- 5Browser Verification2 people · 2 points · first shared 2016 · discussion on HN
- 6Close1 people · first shared 2017
- 7Pngw.tgz1 people · first shared 2014
- 8Vi1 people · first shared 2011
- 9Test1 people · first shared 2010
- 10Ed.c1 people · first shared 2013
- 11Ed.c.orig1 people · first shared 2013
- 12Zero timeout1 people · first shared 2010
- 13Vim hints1 people · first shared 2009
What HN people wrote when they linked it
geocar · 2020-10-13
Nail on head. Pthreads is an extremely difficult API to use, owing first to a poor choice of primitives, the consequences of which are that none of the implementations are particularly good and their interactions with the rest of the machine/model are ill-defined.
For example: You know how hard it is to close() in a multithreaded program? [1] And that’s just one system call— one almost everyone thinks they understand. What hope is there for all the other pthreads-code?
For cond/etc: One trick I use is handle passing via an epoll[2]. This works much more reliably than the pthreads API, and whilst it’s slower in a microbenchmark that spins the pthread_cond/mutex/etc apis, real programs don’t do that (or don’t need to), and so it is usually a clear net-win.
[1]: http://geocar.sdf1.org/close.html
[2]: http://geocar.sdf1.org/fast-servers.html
rpz · 2026-03-05
Reminds me of https://geocar.sdf1.org/fast-servers.html