[Dprglist] Multi-threading on multi-cores

Murray Altheim murray18 at altheim.com
Mon Oct 19 03:22:21 PDT 2020


Hi,

I've been having a discussion with David A. on the subject of writing
a subsumption architecture for a robot OS in multi-threaded Python,
and was drafting a note to him and thought I'd instead pass it along
to the group since I'm curious as to others' experience.

To what I'm guessing is a fair extent we're all hardware hounds here,
folks who like to try out new things. My KR01 and KRZ01 robots use a
Raspberry Pi 3 B+ and a Pi Zero W respectively. I've played a bit with
a micro:bit and Arduinos but mostly Pis.

I just put in an order for a NanoPi Fire3, which runs an Octa-Core
(eight-core) Cortex-A53 ARM chip, each core running at 1.4GHz.

   NanoPi Fire3-LTS
   https://www.friendlyarm.com/index.php?route=product/product&product_id=206

I'd also considered the Orange Pi Zero Plus2,

   http://www.orangepi.org/OrangePiZeroPlus2/

which uses a "little.big" architecture: one quad-core Cortex-A53 and a
quad-core Cortex-A7; eight cores but half are a bit slower, whereas on
the Fire3 all eight cores are identical.

The NanoPi Fire3 sells for US30, the Orange Pi Zero Plus2 for about US$24.

In either case, running a multi-threaded Python application on eight cores
means you get real multi-threading rather than simulated multi-threading,
as you would on a single CPU. [Note that in Python multi-threading is quite
different from multi-processing.]

 From a programmer's perspective, you may be running the same code but
there'll be a real difference performance-wise, since the processes are
farmed out across four, six or eight cores. For me, part of playing with
hardware is exploring this kind of thing.

----

On a related note, some guy took 12 of these Fire3 boards (remember, that's
about $360), put them into a cluster, then ran a Linpack benchmark, getting
about 60,000 MFLOPs performance out of his little 146x151x216mm box that
weighs 1.67kg. By comparison -- one he makes on his webpage:

   https://climbers.net/sbc/nanopi-fire3-arm-supercomputer/

a 1992-era Cray C90 is only about a sixth as fast as that at 10,780 MFLOPs,
cost $30.5 million and weighed 12 US tons. Took up a bit more space too.

He does point out that the Fire3 board is about 6.6 times faster than a
Raspberry Pi 3. And it still has a Pi-compatible GPIO bus, so I'm looking
forward to seeing how this little board fares.

I also put in an order on AliExpress for an Orange Pi 4, which runs a 6 core
Rockchip RK3399 CPU (internally that's another little.big dual-core
Cortex-A72 and a quad-core Cortex-A53) running at 2GHz, 4GB memory, 16GB
of flash, a GPU, PMU, Ethernet and WiFi, Pi-compatible GPIO, all for US$60.

I *might* consider this for a robot but am really buying it as a local server
to run things like gitlab, etc., which is what my Nvidia Xavier NX is now
doing since I've failed 4x to install Cuda nvGraph on it, the original
reason I bought it *grumble*. I won't go into detail why I might want a
whole bunch of small servers except to say I'm playing with microservice
architectures both at home and work. It's a good excuse anyway...

I wonder if anyone on the DPRG mailing list has any experience with the
Orange Pi or NanoPi boards they'd like to share. The Fire3 seems very suited
for robotics, though it doesn't have built-in WiFi like the Orange Pi, would
need a USB dongle.

Cheers,

Murray

...........................................................................
Murray Altheim <murray18 at altheim dot com>                       = =  ===
http://www.altheim.com/murray/                                     ===  ===
                                                                    = =  ===
     In the evening
     The rice leaves in the garden
     Rustle in the autumn wind
     That blows through my reed hut.
            -- Minamoto no Tsunenobu



More information about the DPRGlist mailing list