S
SRLoka
I am developing a C# windows service that gets a continuous stream of bytes
via TCP. As soon as it finds the delimitters(that we have defined), it needs
to pass the data to another thread for processing. The receiving thread does
not care what happend to the data(no thread sync needed). I am thinking of 2
approaches
1) Have a parser class with a constructor and create a new class(passing the
data as parameter) every time there is data and start a new thread that will
process the data and terminate.
2) Have a global queue(FIFO) and just add the data to the Q. The parser
thread is continuously running in a loop(probably with some sleep time)
checking the Q.
Which is the better method and why ?
Thank You for any suggestions or links.
SLoka
via TCP. As soon as it finds the delimitters(that we have defined), it needs
to pass the data to another thread for processing. The receiving thread does
not care what happend to the data(no thread sync needed). I am thinking of 2
approaches
1) Have a parser class with a constructor and create a new class(passing the
data as parameter) every time there is data and start a new thread that will
process the data and terminate.
2) Have a global queue(FIFO) and just add the data to the Q. The parser
thread is continuously running in a loop(probably with some sleep time)
checking the Q.
Which is the better method and why ?
Thank You for any suggestions or links.
SLoka