Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27248

Best Way to Start New Task/Thread from Asynchronous Event

$
0
0
Hey All,
I'm reading in from a comport from the datarecieved event and placing the bytes into a synclocked queue. (producer)

Currently I'm running a timer on a separate thread to check for the number of bytes in the queue and if the queue is greater than my packet size I process the data. (consumer)

I'd like to change from a polled consumer to an event driven consumer. (just seems like a better methodology)

Can anyone recommend a preferred way to either raise event to be executed on a separate thread, or simply start a task from the datarecieved event if the queue is greater than packet length?

Really, if you (as a community) were programming this, what would your approach be?

Thanks,
Nick

Viewing all articles
Browse latest Browse all 27248


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>