![]() ![]() ![]() Basically, the way I chose to do multithreading is the C way of doing it. It is FAR easier than dealing with non-overlapped I/O.Īs for whether this is C or C++, the distinction between the two is very fine. While this may seem like an overly complicated way of doing things, trust me. The regular part of the program then keeps reading this struct over-and-over again and updating the display as needed. It is of type RoboData, which is basically just a struct with a variable to store each byte in. In my Linux dashboard viewer, for example, all data is stored in a global struct called gRoboData. Far and away the easiest way of doing this is through a global variable. This child process, to use the official name, would also deal with getting the data to the user interface. One of them deals with all the user interface stuff (mouse clicks, menu selection, displaying text, etc), while the other one ONLY talks to the serial port. Basically, you can think of this as two programs running concurently. They both work because the processor looks at one program and then the other – they are independant. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |