Originally Posted by
willemjav
the many hidden background stories of ..
I was busy yesterday, finally got a script to run late at night so I did not have time to crawl your code. You have, however you got there, arrived at the central issue on threading - do not know when something will happen - and there lay the keys to your code design. Spin loops are generally considered to waste processor power, thus whether sleep and yield work correctly become central design issues. Unfortunately, robust design of para-realtime scheduling is beyond contemporary practice in Java.
Sun Java Real-Time System - Mediacasts
Efforts are in place to achieve a more robust wording that scales to mainframe.
Dr. Doug Locke may have some advanced observations if you wish to study the matter. Bascially, use synchronized, do not try to do it with bumping priorities. Choose one class, ala hardwired's recent post in the other thread, to be your main class - which should somehow account for button pushing in the GUI - my design has a clock in a hard spin, we do if ( boolean ) in that class ( instance ? ) and manipulate that boolean from the controller class ... we can think of the clock as a Propogator, but you can call me Alligator.
( ! )