c# - WPF: Serialport Communication using TAP -


I may be totally out in the woods on this, but. Since tape (Task-based asynchronous pattern) separates background operation logic from your UI / ViewModel update code, so it would be good to do this because communication with a serial port

However, serialport EAP () Uses, or I believe that this is so.

So my question is essentially, can TAP be used with serial port, and is it

// record

ps if any TAP / EAP / APM tag (or simple asynchronous-patterned tag) can be tagged correctly, this can be tagged correctly, I would be most grateful (I lack the representative for that) .ds

As we know that the tap is heavy memory in memory Yuteshnl good operating , and IO-bound bad for the operation, and to communicate via serial ports is a IO-bound operation .

So, I do not think this is a good idea to change tap from EAP. Because:

For example, your code performs one task, which sends some data to the COM port. At the other end, a device will take that data into the process, and the time required for data processing can be several seconds. During that time, do you work in the processor several seconds before releasing it, so will the thread hold? It will actually be disabled, IMHO

PS: Can you tell what you are trying to achieve?


Comments