8 ms·
I feel like this article doesn't address the crux of why multithreading can't be faster. Kinda smells like LLM-style writing too - a lot of text that sounds lik
by ratmeadow 2y ago
I feel like this article doesn't address the crux of why multithreading can't be faster. Kinda smells like LLM-style writing too - a lot of text that sounds like it's explaining something but skips too many details to be a great argument.
- arghwhat 2y agoI mean, the only caveats of multithreading (apart from bugs) is whether you can obtain full linear scaling or if your data structures require synchronization to the point of becoming bottle-necks. In case of a database, the majority of the work done by the process is in accessing big, shared data structures, which can lead to a lot of congestion. One has to go out of their way to create structures that do not require writers to have exclusive access that penalizes read (e.g., a write log that is occasionally merged), but then you still have to sort out write congestion. When perfected to allow maximum performance, the structure still ends up more complicated and will not allow fully linear scaling. With a single-threaded model you lose parallelism, but you gain the ability to use the simple structures with reckless abandon, and performance is linear over the average request processing time. Other types of applications do not necessarily have these limitations. E.g., you can make a multi-threaded webserver that requires no synchronization as it works off static data with requests and connections being entirely thread-local. The application could also be compute-bound, with the time spend accessing contentious shared structures being just a minor part of the execution time.
- brazzy 2y agoIt's a (possibly machine-generated) translation of a Chinese article linked to at the bottom, which contains a number of diagrams that the translation lacks (even though it refers to a diagram at least once).
- Lockal 2y agoYeah, this looks like summarization by LLM (probably from Chinese article). For example, there are definitely more than 5 datatypes in Redis: LLMs have no idea what can be summarized in which way.