我与我希望定期监测的频率为1至1/10 Hz(尚未决定)的装置有序列链接。
我希望来文不要锁定,因此,我决定把来文放在某种意义上的边缘,让主要申请通过从深线发射的事件获得数据。
I was thinking about making a thread at application start that sends and receives data continuously. The thread empties a queue containing commands to send to the device, and then listen for response firing an event when a response is complete. The thread is put to sleep when no commands are in the queue, and woken when commands enter the queue.
Is this a good way of doing it? I was thinking about maybe using some of established features of the framework, like BackgroundWorker or Task, since these might have advantages over what I m doing. Maybe there are other and better ways of accomplishing this?