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
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