M
Marco Trapanese
Hello,
in my application I need to send on a serial port a request, wait for
the answer and update some controls on the form. In the meanwhile the
user should be able to use the GUI without any problem.
So I ended up in the following way:
* in the tick event of a timer (100 ms) I create a new thread. It sends
the request, receives the answer and updates the controls (through
Invoke method, of course).
It works fine, but there are no difference from do the same in the main
thread. I'm talking about some delays when clicking buttons. These
delays are due to the send/receive/elaborate functions. In fact, if I
comment out them I don't experience delays anymore.
I bet the multithread solution should fix the issue, but I was wrong.
May you help me? How would you do this?
Thanks
Marco
in my application I need to send on a serial port a request, wait for
the answer and update some controls on the form. In the meanwhile the
user should be able to use the GUI without any problem.
So I ended up in the following way:
* in the tick event of a timer (100 ms) I create a new thread. It sends
the request, receives the answer and updates the controls (through
Invoke method, of course).
It works fine, but there are no difference from do the same in the main
thread. I'm talking about some delays when clicking buttons. These
delays are due to the send/receive/elaborate functions. In fact, if I
comment out them I don't experience delays anymore.
I bet the multithread solution should fix the issue, but I was wrong.
May you help me? How would you do this?
Thanks
Marco