Number of processor cores confusion
Gene Heskett
gheskett at shentel.net
Tue Nov 10 17:47:04 UTC 2020
On Tuesday 10 November 2020 09:20:15 Chris Green wrote:
> On Tue, Nov 10, 2020 at 02:59:25PM +0100, Volker Wysk wrote:
> > Hi!
> >
> > Your answers made me wiser. So I have one socket, with 8 cores and
> > two threads per core.
> >
> > This means there are 16 actors working for me. (Even though they
> > might not be full replacements für real cores). Not bad. I thought I
> > still had 8. :-)
>
> However, in reality, *very few* things running on your computer ever
> use more than one thread/core. Almost all of the time only one is
> being used.
>
> I have only seen a couple of rather specialised bits of code that
> manage to use more than one core, one of them was the password
> security checking program crack_known_hosts.py, I think I also noticed
> a static web site generating program doing it too.
>
> It's difficult to write multi-threaded code so most people don't, the
> only (moderately) easy candidates for it are things which do intensive
> processor bound things without any I/O (like the above password
> cracking and/or image processing programs). Anything that uses system
> libraries and I/O is almost inevitably single threaded.
There are of coarse exceptions.
I might point out that some of the industrial programs do use multiple threads. Free LinuxCNC for instance can use at least 2 and perhaps 3 threads. If not using smart cards for realtime i/o to run machinery demanding steady trigger signals because stepper motors are adversely affected by timing jitter, you run at 30 microsecond loop for the realtime stuff, and a 1 millisecond loop to update the servo status, with floating point only in the slower loop.
On an rpi4 with smart card i/o, some of the interface stuff is running in a 200hz loop because that's plenty fast enough for human input. I suspect the faster base-thread could also be used on the pi's but the i/o to use it isn't there. Not having a pci-like buss, the pi talks to the smart card with a 4 byte serial data stream over three pins of gpio, called an SPI bus sending at 40 megabaud, and receiving the answers from the card at 25 megabaud. And its bulletproof. Best described as Just Works.
It is running an 80 yo 11x56" Sheldon metal lathe, including motion compensation for 80 years of bed wear. Weighs arounf 1500 lbs. And now does things much fasrer that it could not even do when new, with a simpler mechanical setup using precision ball nuts and screws.
And the only coupling between the spindle and the rest of it is electronic, there no gears on the back of the headstock, its all synchronized by a shop made encoder watching the 60 tooth gear in the headstock. Thats 240 edges per turn of the spindle, so LinuxCNC knows within 1.5 degrees where the spindle is. Cutting threads is all math in the rpi4, metric or 'merican. Why use a pi? I wanted to see if I could.
I have 3 other machines but they are all run by wintel boxes running linux. 4 or more axis milling machines.
> Chris Green
Your trivia fact for the day. Take care everybody.
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20201110/5e1b998a/attachment.html>
More information about the ubuntu-users
mailing list