| ▲ | pirocks 14 hours ago | |
> Multithreading does not make code more efficient. It still takes the same amount of work and power (slightly more). In addition to my sibling comments I would like to point out that multithreading quite often can save power. Typically the power consumption of an all core load is within 2x the power consumption of a single core load, while being many times faster assuming your task parallelizes well. This makes sense b/c a fully loaded cpu core still needs all the L3 cache mechanisms, all the DRAM controller mechanisms, etc to run at full speed. A fully idle system on the other hand can consume very little power if it idles well(which admittedly many cpus do not idle on low power). Edit: I would also add that if your system is running a single threaded database, and a single threaded web server, that still leaves over a hundred of underutilized cores on many modern server class cpus. | ||
| ▲ | groundzeros2015 13 hours ago | parent [-] | |
Responding to your last point. If you use a LAMP style architecture with a scripting language handling requests and querying a database, you can never write a single line of multithreaded code and already are setup to utilize N cores. Each web request can happen in a thread/process and their queries and spawns happen independently as well. | ||