5 ms·
If your problem is small enough fore one thread it's not interesting here
by spacemanmatt 5y ago
If your problem is small enough fore one thread it's not interesting here
- bob1029 5y agoHere is a problem that is small enough for one thread: https://lmax-exchange.github.io/disruptor/disruptor.html https://lmax-exchange.github.io/disruptor/disruptor.html A financial exchange does order matching at rates of millions of transactions per second on a single thread because its literally the fastest way to do things. Would you consider operating the most important part of any financial exchange on a single thread "not interesting"?
- spacemanmatt 5y agoWould you consider a concurrent system executed by a single thread in a financial exchange to exemplify "indie devs avoid multithreading?"
- bob1029 5y agoThe point I am ultimately trying to make is that, in many cases, the reason to avoid multi-threading is because it's not actually the fastest way to do something. It's that simple. The implicit concern (if you could not infer from the content of my link above) being that the developer community is completely blind to the performance capabilities of a single computer/core/thread in 2022 and are inclined to automatically skip over these simple solutions in favor of a multi-threaded solution.
- spacemanmatt 5y agoI feel like that is a point that doesn't need making because it's sorta elementary that task switching is expensive and avoidable in some cases. Especially when the explicit context is indie development, not squeezing some performance out of the threading model at large scale.