Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
exDM69
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
73 ms
·
721.
▲
by
exDM69
9y ago
Sorting is a fundamental problem so this is important stuff but I can't right now come up with a practical problem involving large sorting operations. Can anyone come up with a practical application for this? I have no doubt they exist
722.
▲
by
exDM69
9y ago
They are useful, just not in multithreaded programming. Overall I am quite disappointed at the level of education with parallelism and concurrency now that we're 15 years into the multi-core era, let alone in the years past. I'm c
723.
▲
by
exDM69
9y ago
I think that building for serviceability would be better than the planned obsolescence with the latest fad included (washing machines with touchscreens). That doesn't necessarily mean poor quality, even if it sometimes did in the Sovie
724.
▲
by
exDM69
9y ago
There's no busy waiting involved with condition variables. The while loop is there to guard against spurious wakeups, and it is not a "busy" loop. A semaphore can be implemented using a mutex and a condition at pretty much th
725.
▲
by
exDM69
9y ago
Do you have an example of a case where a semaphore helps with high contention? I would think that using a lock free atomic solution would win there, assuming the contention is high and consistent. Even if the semaphore is marginally faster
726.
▲
by
exDM69
9y ago
The 25 ns is from "Latency numbers every programmer should know" [0], and the 2017 edition puts it at 17 ns. That's essentially the cost of an atomic operation in the CPU interconnect. A futex is a way to implement a mutex so
727.
▲
by
exDM69
9y ago
No. Not really. Programs should be optimized for the uncontended case where a mutex and semaphore are pretty similar. Some textbook toy problems are theoretically faster with semaphores but that's not really the case for practical prob
728.
▲
by
exDM69
9y ago
Indeed. When you have a mutex+condition, you can add instrumentation like logging or timers for debugging, testing and verification purposes.
729.
▲
by
exDM69
9y ago
Highly contended queues aren't very common, at least in the kind of programming I do. If contention is extremely high and throughput is paramount, then a lockless solution might work. E.g. audio processing or network stacks might have
730.
▲
by
exDM69
9y ago
The point is that implementing a semaphore with a mutex and condition is very easy but more versatile. A semaphore only has a single integer internal state, a condition can guard any number of shares variables. I see no reason to use semaph
731.
▲
by
exDM69
9y ago
That's a common misconception, obtaining an uncontended mutex (futex) is just a single atomic operation that takes about 25 nanoseconds. Lock-free programming with atomics is even more difficult than reasoning about code with locks. It
732.
▲
by
exDM69
9y ago
Semaphores are nice for text book examples, but should be avoided in practical multi threaded programming in a shared memory environment. A mutex and condition variables usually provides a cleaner solution that is easier to reason about. In
733.
▲
by
exDM69
9y ago
But that's just gross neglect. As a cat owner, I have to deal with the occasional pee on the floor and there are specialized detergents that are very effective in getting rid of the smell. You do get desensitized to the smell, though.
734.
▲
by
exDM69
9y ago
40 km/h is not impossible by any means but as a sustained average speed it takes a special bike and a person with pretty mighty athletic background. Definitely not something for the average commuter. Even 20 km/h sustained for an
735.
▲
by
exDM69
9y ago
40 km/h average is crazy! I can get slightly above 20 km/h sustained average for about an hour. There's no way I could double that, and I'm pretty fit. My 20 km/h includes a few stops and normal traffic so it's
736.
▲
by
exDM69
9y ago
Pinning threads to cores with affinity is another technique that should be used with caution. Under normal circumstances the kernel will run the same thread on the same core as much as possible because CPU migration is expensive. Setting CP
737.
▲
by
exDM69
9y ago
An uncontended mutex is just as fast as a spinlock (on modern operating systems using a futex). It takes about 25 nanoseconds to lock it. The difference is when there's contention. A spinlock will burn CPU cycles but a mutex will yield
738.
▲
by
exDM69
9y ago
Yes, they should use modern kernels but that has not happened yet. I am appalled by the practice of keeping customers on old software and sometimes even without proper security patches. I hope regulators (EU in particular) will act on this
739.
▲
by
exDM69
9y ago
> the key being 'volatile' which is a Java keyword with a specific meaning that constrains the order of operations and write visibility across threads. I must point out that "volatile" in Java means something complete
740.
▲
by
exDM69
9y ago
They have incredibly accurate position data (GPS + radio beacons, etc) but that can't be used to control the engine map. The engine map has a finite number of allowed inputs and a bunch of restrictions they must adhere to. For example
741.
▲
by
exDM69
9y ago
Are you interested in tool making professionally or as a hobby? Or a small side business? I'm short of a chuck for an egg beater hand drill so if you intend to produce some, I'm interested. If professionally, I suggest thinking ab
742.
▲
by
exDM69
9y ago
Sounds like a fantastic shop space! Mortising machines are not that uncommon in shops, we had one in my school and also a school I went to take woodworking classes as an adult a year or two back. Those machines tend to be high maintenance (
743.
▲
by
exDM69
9y ago
Sadly, Fiskars is one of those declining companies that are taking part in a race to the bottom with price and quality. Being from Finland (where Fiskars is from), it's often the default go-to brand for gardening equipment and similar.
744.
▲
by
exDM69
9y ago
It's really sad that auger bits for braces aren't manufactured any more as far as I can tell. There are places that sell new old stock, and there are Irwin bits available but only in sets worth $500 (not sure if new or old stock).
745.
▲
by
exDM69
9y ago
What a disappointment. CastAR was probably my favorite contestant for a VR/AR gadget. And the reason is quite simple: I do flight and racing simulators. Anything involving a headset that occludes vision of your surroundings makes it im
746.
▲
by
exDM69
9y ago
Well, Alan Kay's definition is just one definition and as evidenced by the rest of this thread, it's far from being universally accepted and definitely not the definition used in the mainstream "OO" languages. Further, t
747.
▲
by
exDM69
9y ago
But it is not an opinion. There is no universally accepted definition of OO let alone a formal, axiomatic definition, and that makes it ill-defined. If you disagree, point to a definition of OO that you think is "correct".
748.
▲
by
exDM69
9y ago
Happens without any extensions. I'm on Arch Linux, not Ubuntu. I don't care enough to debug it further. Firefox is stable enough these days that restarting it isn't even a daily occurence. I have enough patience to wait that
749.
▲
by
exDM69
9y ago
Nope. It's a lightning fast m.2 SSD. And warm caches don't help either.
750.
▲
by
exDM69
9y ago
Amen. Where I live, the biggest traffic noise is mopeds with tuned exhausts driven by obnoxious 15-year olds late at night. They're louder than most racing cars I've heard. Certainly much much louder than the V8 cars at the muscle
More ›