Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
gsliepen
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
151.
▲
by
gsliepen
3y ago
Indeed. Also, spinlocks are not that great in userlang where one thread can preempt another thread that is holding a spinlock, which means threads on other cores that also want that lock would spin for a whole timeslice and burn a huge amou
152.
▲
by
gsliepen
3y ago
If multiple cores are trying to do atomic operations on the same value, the hardware typically is not fair. For mutexes, it depends on whether the operating system wakes up waiters in a fair way. Often that is not fully fair either. If ther
153.
▲
by
gsliepen
3y ago
But a lockless algorithm would have the same amount of cache-line bouncing in the uncontended case. In the LWN series about lockless algorithms, there is a lot of detail about the atomic primitives used in them, but apart from ringbuffers,
154.
▲
by
gsliepen
3y ago
Yes, only a few lockless algorithms require only a single atomic operation. And as soon as you need to do cmpxchg in a loop and there is contention, you can burn a lot of cycles while cache lines bounce between cores, potentially an unbound
155.
▲
by
gsliepen
3y ago
"Lockless" sounds very positive, and it's tempting to think that everything should be made lockless. However, it's less great than it sounds. Mutexes are very cheap in the uncontended case, and in the contended case they
156.
▲
by
gsliepen
4y ago
While the situation is definitely undesirable, it's not Arm's fault that it is hard to update your SBC. Arm doesn't make the single board computers (SBCs), they just license processor designs to system-on-chip (SoC) vendors,
157.
▲
by
gsliepen
4y ago
What makes you think they don't? A quick search will reveal things like: https://developer.arm.com/documentation/101897/0301
158.
▲
by
gsliepen
4y ago
I read the book for the first time at that age, and I definitely enjoyed it. While I knew some things were over my head, a lot of concepts are actually explained well enough that a 14 year old can grasp it, and the dialogues are a lot of fu
159.
▲
by
gsliepen
4y ago
The frame buffering is a physical feature of the CCD. It actually has twice the number of lines, but half of them are behind a mask so they will never be exposed. When the exposure ends, it rapidly shifts the accumulated electrons from the
160.
▲
by
gsliepen
4y ago
"It's just math." But math can be expensive, and in the fragment shader you are calculating everything per-pixel, whereas if you provide your geometry to the vertex shader, you only have to calculate something once per vertex
161.
▲
by
gsliepen
4y ago
For C and C++: cppreference.com. Why? - Very good overview pages. - Everything is cross-referenced. - Almost everything comes with an example of how to use it. - It's a wiki, so you can edit it yourself if you find anything lacking.
162.
▲
by
gsliepen
4y ago
I did the same as PaulDavisThe1st; gtkmm is an excellent C++ interface for Gtk, such that I wonder why they even bothered to create Vala except for NIH syndrome. Qt had similar issues in the past: it wasn't pure C++, it was C++ "w
163.
▲
by
gsliepen
4y ago
Not if CHAR_BIT is 10 or more!
164.
▲
by
gsliepen
4y ago
Well, in C++ int('1' * 4301) is a perfectly valid expression, but it evaluates to 210749, not 4301.
165.
▲
by
gsliepen
4y ago
It's worse than that. `char`'s signedness being implementation defined is one thing, but then having the standard library provide a function called `getchar()` that returns not a `char` but an `unsigned char` cast to an `int` is d
166.
▲
by
gsliepen
4y ago
It's not just a tiny CPU. Microcontrollers typically have a bunch of "peripherals", blocks which implement a specific function or protocol, like SPI, I2C, PWM, DAC, ADC, and so on. For a given project, choosing the right micr
167.
▲
by
gsliepen
4y ago
Diode Gone Wild is another channel in the same vein (minus the carbonated beverages): https://www.youtube.com/c/DiodeGoneWild I very much like the approach taken by Big Clive and Diode Gone Wild: taking apart everyday
168.
▲
by
gsliepen
4y ago
There are several power saving levels available on the ESP32. At the deepest power saving level, it's actually quite efficient, but it will also have shut off power to the RAM, meaning that if the device wakes from a timer or an interr
169.
▲
by
gsliepen
4y ago
It seems Nikon has introduced the Z-mount for its mirrorless cameras, and you have an adapter to go from Z to the F-series mount for older lenses. There will be Z-mount lenses specifically designed for mirrorless, but there might also be le
170.
▲
by
gsliepen
4y ago
I think I never tried enabling live view boost for night time shots. I'll try it out, thanks!
171.
▲
by
gsliepen
4y ago
For low light some electronic viewfinders are actually worse than optical ones. I have a (rather old) Minolta dImage 7i which does binning on the sensor in low light, giving excellent results in darkness, but my Olympus OM-D EM1 does not do
172.
▲
by
gsliepen
4y ago
But that's almost the only thing they are superior in. Mirrorless cameras have ways to mitigate the problem somewhat, for example by having sensors to detect if your eye is actually looking through the viewfinder, and if not they will
173.
▲
by
gsliepen
4y ago
While the C standard does say that integer promotion happens, if the result is being cast back to char again, a C compiler will see that it doesn't need to operate on 16 bits and is allowed to optimize the result back to 8 bit operatio
174.
▲
by
gsliepen
4y ago
The problem is that there are still mechanical bits inside electronic locks, and now you have two areas of attack: the mechanics and the electronics. And as already mentioned, they often have a mechanical lock mechanism as a backup for if t
175.
▲
by
gsliepen
4y ago
You might not need that kind of processing power continuously, but consider that the lamp has to connect to WiFi securely, then talk to your smart home HUB securely, meaning setting up TLS connections, and you want it to respond to commands
176.
▲
by
gsliepen
4y ago
It's not uncommon to be resource constrained on embedded devices. I actually worked on something quite similar as kayson, helping create a device to synchronize a camera with a LED that was pulsed with a constant current in order to ge
177.
▲
by
gsliepen
4y ago
That's a good point. What if enough miners quit such that suddenly one of the big mining groups gets a majority?
178.
▲
by
gsliepen
4y ago
> The danger of the right-half-plane zero is that it lures you into reacting to it, but that is precisely the wrong thing to do. Attempting to apply a new control input to cancel the inverse response only sets off an even worse chain of
179.
▲
by
gsliepen
4y ago
They don't need to; it is the kernel that implements TCP, and on Linux at least you can easily change the congestion control algorithm that is used and some other parameters. Again, UDP doesn't magically solve anything, and QUIC i
180.
▲
by
gsliepen
4y ago
There is nothing inherently wrong with modern TCP for long distance data transfer. You do need to use the right congestion algorithm and some extensions enabled to handle large window sizes to get high speeds at long distances. But UDP does
More ›