K
Kenny Carruthers
Hoping someone can shed some light on the proper way to
setup multithreading for the following:
I've got a basic 'C' based dll with a reader thread in it
that is reading from a USB port. This reader thread is
calling a through, via a delegate, to a method in my C#
app. In turn, this C# method is processing the newly
arrived data and then firing a local event. Listeners to
this event, receive the new data and display the
information in a scrolling list. (Basically I am creating
a scrolling log of data read from a USB port).
The problem that I run into is that pretty much all this
is happening on the UI thread and performance is pretty
slow. It would appear that while my form is updating
itself in the paint method (via a call to Invalidate()) I
do not receive data from the dll via my C# delegate.
How can I set this up so that my deletage that handles the
dll-to-C# communication is not running on the UI thread?
Since the dll is already threaded, I just need to set
things up so that my C# "reader" delegate is not on the UI
thread but I can't figure out the syntax to do that.
Any help or ideas on a better way to do this would be
greatly appreciated.
Thank you,
Kenny
setup multithreading for the following:
I've got a basic 'C' based dll with a reader thread in it
that is reading from a USB port. This reader thread is
calling a through, via a delegate, to a method in my C#
app. In turn, this C# method is processing the newly
arrived data and then firing a local event. Listeners to
this event, receive the new data and display the
information in a scrolling list. (Basically I am creating
a scrolling log of data read from a USB port).
The problem that I run into is that pretty much all this
is happening on the UI thread and performance is pretty
slow. It would appear that while my form is updating
itself in the paint method (via a call to Invalidate()) I
do not receive data from the dll via my C# delegate.
How can I set this up so that my deletage that handles the
dll-to-C# communication is not running on the UI thread?
Since the dll is already threaded, I just need to set
things up so that my C# "reader" delegate is not on the UI
thread but I can't figure out the syntax to do that.
Any help or ideas on a better way to do this would be
greatly appreciated.
Thank you,
Kenny