3 ms·
>> CPUs have a similar memory hierarchy, the difference is that you're a context switch away from losing your preciously cached data. That's an argument for mo
by phkahler 10y ago
>> CPUs have a similar memory hierarchy, the difference is that you're a context switch away from losing your preciously cached data.
That's an argument for more cores, each with it's own cache. It also suggests that the OS schedule all of the low CPU load tasks on the same core to prevent context switching on the big workloads. I'm not sure if that's how it's done today, but when my dual core is busy the CPU usage graphs tend to switch places regularly.
- jacquesm 10y agoThere are more levels of caching, some shared, some not. For instance, in a one particular quad core CPU all cores would have their own L1 cache, but cores 0 and 1 share the same L1 cache, and cores 2 and 3 another L1 cache. Then finally all cores share the same DRAM. So depending on whether your tasks have been 'pinned' to a certain core you might see a smaller or bigger hit when there is a context switch and a migration of a task that is not pinned to a certain core might flush L1 or both L1 and L2. Of course every architecture has its own quirks so to gage the impact you'd have to know exactly how things are set up in that particular machine. Another set-up (the one I'm writing this on) has 32 K per core L1 cache, 256K L2 cache and a 15 MB shared L3 cache. Migrating from one core to another on this machine is cheaper than on the four core example above.