shoneill Posted December 13, 2018 Report Share Posted December 13, 2018 (edited) On 12/15/2009 at 5:35 PM, Daklu said: I discovered a case of 'QSM parallism.' What I mean by this is that a state queues up more states with the expectation that they will be executed immediately, but the queue still had states on it that it needed to execute to complete a previous process. That essentially (unintentionally) splits the execution into two separate paths that are interleaved on the queue, which of course leads to unpredictable behavior. The odd thing is the software seems to be working okay. I suspect dark magic is at work but I loaned out my copy of "Software Exorcism for Dummies" and haven't got it back yet. Separate out the external Queue from the internal one. If the internal queue has elements in it, ignore the external queue. Only read an element from the external queue when the internal is empty. You can extend this to N layers by maintaining a stack of queues, where element zero is the external queue (should never be destroyed). All internal states which enque further states do so on a newly-created internal queue and pushes all other queues down the stack. This way you get deterministic execution of your states. Guaranteed execution order without interruption and a way of investigating the execution flow (depth of stack and so on). Of course when an internal Queue is empty, it is destroyed and the top-most queue is retrieved from the stack. I keep coming back to the definition of a "Pushdown Automaton" even though it really does not fit, but it helps me to visualise what's going on. Imagine that the input tape and the stack are the same thing. Each input tape is an element of the stack. Pushing and popping input tapes allows you to essentially create subroutines. Edited December 13, 2018 by shoneill Quote Link to comment
drjdpowell Posted December 14, 2018 Report Share Posted December 14, 2018 20 hours ago, shoneill said: Separate out the external Queue from the internal one. You're a bit late for this conversation, though the topic is still very relevant today. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.