On 12/14/24 17:06, Bertho Stultiens wrote:
On 12/14/24 10:57 PM, andy pugh wrote:
Probably done as an "it should not hurt" effort. However, using
volatile
on shared variables in a multi-threaded context is wrong, plain and
simple, and therefore actually harmful.
Is our realtime layer multithreaded? I have always thought that it was
deliberately single-threaded, but have never really looked to see.
There are multiple threads attached to the same shared memory. Whether
these threads are part of one process or divided between multiple
processes does not matter. They share part of the accessible memory
space by using shared memory for which the proper synchronization is
required.
The threads are prioritized I've been told, with the fastest getting
the highest priority, The pi running my Sheldon has 2 threads but could
have a 3rd if it used a parport to drive steppers. I have the usual 1
kilohertz "servo" thread, and a 200HZ thread handles all the manual jog
dial stuff. I did that originally on a pi3 but that pushed it pretty
hard, causing an occasional stutter, so I set up the second, even
slower thread to handle the manual encoders that let me drive it just
like it still had cranks. Now that its driven by an rpi4 I could put
that stuff in the servo thread but its working so sweet I've not found a
round tuit.
Merry Christmas everybody.
Cheers, Gene Heskett, CET.
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
- Louis D. Brandeis
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers