Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I'm having issues.lol.
I have a UI, and a second, comms, thread that will be simply looping and sending and recieving data to RS232 as frequently as possible.
I'm struggling to figure the best way to have the data shared between the threads so the user can enter new co-ordinates in the UI and it will process the change and alter the data that the comms thread reads, in a fashion that gives the required acceleration and speed of movement of the item.
I'm wondering if it would be better to use some sort of a stack of co-ords (co-ords are actually in a 23 byte string) written in one go by the UI thread, and picked off one at a time by the comms thread (down to the final position at which it will continue sending that position)instead of an intensive UI thread, bearing in mind that the other end of the RS232 is sat expecting constant data feed with no more than 250ms between new co-ords.
I'm guessing I'm using CS's too which dont appear to be a prob on the surface. I'm hoping not anyway!
My backgroud = new to programming so go easy :)
0 · ·