4 ms·
A 6-bit variable would be enough to hold 64 values.
by kijin 7y ago
A 6-bit variable would be enough to hold 64 values.
- Adrock 7y agoThat doesn’t allow you to use it as a bit mask, which is what OP was saying.
- phamilton 7y agoAnother way to express this is that a 64-bit value can express every combination of processors, so if you want to say something like "this process should run on these 12 specific processors" you can do so in a single 64-bit value.
- thedance 7y agoThere are loads of places where it’s more convenient to test a bit vector than compare a scalar value. It’s just cheaper at runtime. Of course it may be possible to cheaply extend the bit vector scheme to 128 bits or even 256 fairly easily, using the native vector registers. But I bet Windows still supports some pretty old models of CPUs.
- dragontamer 7y agoBut you need 64-bits to represent affinity masks and scheduling. IE: Which of the 64-cores are available for a thread to schedule into. ---------- Furthermore, your Threadripper 3990x should ONLY really be pushing affinities for across a 8c / 16-thread die anyway, at least as far as the Windows scheduler is concerned. Windows programmers should use multiple thread groups for different 16-thread CCX. Because its extremely costly to move all of your local state from one die's L3 cache into another. https://images.anandtech.com/doci/15318/amd_rome-678_678x452_575px_678x452_678x452.png https://images.anandtech.com/doci/15318/amd_rome-678_678x452... Look at the chip, like physically look at it. AMD has 9x chips here (1x I/O die for memory, and 8x compute chips, each with 8x cores). You really only want to be moving threads within those 8x cores, because moving a thread across chips is less efficient. So the ideal world, people would understand Windows's scheduler and work around it. Instead of complaining about how it is different from Linux's. Windows's Thread groups being 64-sized is reasonable for the job it wants to do... and there are other parts of the API that allow you to work across Window's 64-sized processor groups. In particular, to increase your affinities across to a 2nd processor group.