That's the surprisingly aesthetic output from the debug version of the latest program:

This is halfway between the look of a cellular automaton and a procedurally-generated maze on an 8-bit console... Every "_" is a datum enqueued by the "slow backwards" thread and every "|" is enqueued by the "fast forward" thread.
And it runs fast !
$ gcc -g -Wall -lpthread -D_REENTRANT -DWIDTH=16 -Os pt_orbit_07.c -o pt_orbit && /usr/bin/time ./pt_orbit Measuring the first orbit of the Pisano-Carry state space for WIDTH = 16 bits, or about 2147516416 iterations. Starting to scan backwards from Step 0 : X=1, Y=0, C=0 Starting to scan forward from Step 0 : X=1, Y=0, C=0 EUREKA !!!! Backwards scan reached forward at X=45918 Y=0 C=0 after 822785867 + 1324730547 = 2147516414 steps and 12706 + 20329 = 33035 crossings C'est fini. 3.09user 0.00system 0:01.55elapsed 199%CPU
The "fast-forward" loop alone runs at about 2.4s and running the slower version in parallel saved 0.9s ! Amdahl's law applies of course and it's not possible to get to 1.2s because the slower part will always hold everything else back. But my flexible synchronisation method with 2 FIFOs works well, at least to keep the speed maxed.
However it doesn't work as expected all the time and there are many misses. I'll have to solve that but you can already play at home with pt_orbit_07.c.
Enjoy !
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
I am currently in New Jersey. I have 40 PCBs that need soldering. I used SMT service but they can only do one layer. I am bad at soldering but this comes with a tight deadline. If anyone has any idea on what to do, or any recommendation to manual soldering service I should go to, that will be a tremendous help. Thank you!
Are you sure? yes | no
blind
Are you sure? yes | no
https://www.youtube.com/watch?v=sWblpsLZ-O8 :-D
Are you sure? yes | no
Add some path-planning and you have a generative maze maker ;-)
Are you sure? yes | no
@Mike Szczys
hahahaha :-)
this shouldn't require using the POSIX threads library ;-)
Anyway this project is full of surprises and discoveries, serendipity at its fullest !
Are you sure? yes | no
It looks like the start of a hack chat poster ;)
Are you sure? yes | no
it's just maths and your own interpretation ;-)
You have the source code, play with the #define (width and verbose) and share the fun !
Are you sure? yes | no
@Richard Hogben
If you want to play I can send you 10K characters of the sequence for W=16.
If you need more, no problem. #define WIDTH to 26 and pump as many as you like.
Are you sure? yes | no