<div dir="ltr"><div><div><div><div><div>To get the benefits of multicore you need to understand two things: CPU architectures and the kernel scheduler.<br><br></div>Current CPU architecture is actually thousands of unique processing units, each one specialized to a different task. There are APUs inside a single core which make it turing complete and a proper processor, but there are unique units for processing string types, stream data (video), and tons for basic mathematic operations. The processor understands where to put all this stuff based on what assembler opcode is used and all that's determined by the compiler (which is why using Intel C Compiler over Gnu C Compiler often yields faster running programs, because it uses all those nifty opcode functions better). This is why hyperthreading is such a cool technology. When you're doing something that taxes all the string-oriented processing units, the processor can still be available for regular algebra and general computing--which is why each core appears as two cpus when you look at the readout--there's the main calculation thread core and the off-calculation core thread. <br><br></div>When we tack on an additional core, some nifty things get added-specifically a thing called cache coherence. The idea is that the second core understands what the first core is working on, and will look at the same memory location and try to guess what the next calculation will be if the second core is idle. So, having multiple cores can increase single thread execution when the extra cores are idle.<br><br></div>Lastly, the kernel scheduler makes a big difference as to how things get sent to the CPU. The scheduler determines what gets CPU time. There are 4 main schedules in use in the wild within Linux, and there names are LinuxThreads (oldest), O(1) scheduler, O(log(N)) or Completely Fair Scheduler, and the BFS (Brain F*** scheduler) which is used on mobile devices. <br><br></div>LinuxThreads says that each process gets its own core after the first one is taxed. LinuxThreads is the main reason why we compile with a make -j (core count *2)+1. This ensures every core and hyperthread avenue will be available to the compiler. O(1) is much more elegant in design, in that it was designed and not just put in place because Linux needed a scheduler. O(1) biases for programs that are sleeping for a long time and actually monitors and learns a processes behavior, then assigns out the total CPUs in 1/250 of a second increments. In O(1), you could make with a single thread and it'd be faster than just using one core, but it'd probably be best to do make -j (core count + 1). O(log(N)) or Completely Fair is a bit different. It just looks at all the processes needing time on the CPU and balances out by whichever one has spent the least amount of time on the core. In Completely Fair, just doing a make and a make -j could actually end at the same time, but I'd say go with make -j (core count -1) for fastest compilation time. You shouldn't compile in BFS.<br><br></div>Nothing makes up for a well programmed multi-threaded application, but there's a lot of hacks going on in the background that makes multiple cores useful for any task.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 31, 2016 at 1:37 PM, Stephen Partington <span dir="ltr"><<a href="mailto:cryptworks@gmail.com" target="_blank">cryptworks@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Correct </p><div class="HOEnZb"><div class="h5">
<div class="gmail_quote">On Jan 31, 2016 1:36 PM, "Michael" <<a href="mailto:bmike1@gmail.com" target="_blank">bmike1@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I was thinking about when I do linux from scratch you need to enter a special flag to utilize both processors during a build.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 31, 2016 at 3:30 PM, Stephen Partington <span dir="ltr"><<a href="mailto:cryptworks@gmail.com" target="_blank">cryptworks@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">The main purpose to allow multiple processes to run at the same time. So more can be done in a given amount of time. </p>
<div class="gmail_quote"><div><div>On Jan 31, 2016 1:28 PM, "Michael" <<a href="mailto:bmike1@gmail.com" target="_blank">bmike1@gmail.com</a>> wrote:<br type="attribution"></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">I was wondering what the purpose of a multi cored computer is. The way I understand it is that multi cores operate on different threads. Doesn't that mean that the a multi cored computer only uses one of it's cores or.... I don't even have enough knowledge about this to ask an intelligent question!<br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><span style="font-size:12.8000001907349px">:-)~MIKE~(-:</span><br></div></div></div></div></div>
</div>
<br></div></div>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" rel="noreferrer" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div>
<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" rel="noreferrer" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><span style="font-size:12.8000001907349px">:-)~MIKE~(-:</span><br></div></div></div></div></div>
</div>
<br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org" target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" rel="noreferrer" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div>
</div></div><br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" rel="noreferrer" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Todd Millecam</div>
</div>