1691
General Mach Discussion / Re: losing probe signals with USB game controller?
« on: February 07, 2010, 04:11:20 AM »
This is why I provided the link in my earlier post. It's all discussed and explained there. I'll reproduce a little here. Tweakie is on the right lines but in detail: while isMoving() wend actually causes the VB thread to WAIT for the mach thread to SIGNAL the VB thread that it has finished doing the last thing it was asked by VB to do.
As I said in the linked thread, isMoving() would have perhaps been better named MachIsBusy() as it actually has nothing to do with whether anything is actually moving.
without this synchronisation of the two asynchronous threads (Mach and VB) the DRO could be read by the VB before Mach has actually updated it.
Any VB "command" to Mach should be seen as a REQUEST: as in "can you do this as soon as possible?" - NOT a COMMAND as in "do it now". Any VB that continues without waiting for Mach to say "OK - I've done it" is unreliable.
Ian
As I said in the linked thread, isMoving() would have perhaps been better named MachIsBusy() as it actually has nothing to do with whether anything is actually moving.
without this synchronisation of the two asynchronous threads (Mach and VB) the DRO could be read by the VB before Mach has actually updated it.
Any VB "command" to Mach should be seen as a REQUEST: as in "can you do this as soon as possible?" - NOT a COMMAND as in "do it now". Any VB that continues without waiting for Mach to say "OK - I've done it" is unreliable.
Ian