Click here to Skip to main content
15,914,286 members
Home / Discussions / C#
   

C#

 
AnswerRe: icon Pin
Giorgi Dalakishvili28-Jun-07 6:14
mentorGiorgi Dalakishvili28-Jun-07 6:14 
QuestionThroughput/Design Problem Pin
tobriain28-Jun-07 5:05
tobriain28-Jun-07 5:05 
AnswerRe: Throughput/Design Problem Pin
Pete O'Hanlon28-Jun-07 5:11
mvePete O'Hanlon28-Jun-07 5:11 
AnswerRe: Throughput/Design Problem Pin
led mike28-Jun-07 5:14
led mike28-Jun-07 5:14 
GeneralRe: Throughput/Design Problem Pin
tobriain28-Jun-07 5:37
tobriain28-Jun-07 5:37 
GeneralRe: Throughput/Design Problem Pin
led mike28-Jun-07 6:25
led mike28-Jun-07 6:25 
GeneralRe: Throughput/Design Problem Pin
tobriain28-Jun-07 6:41
tobriain28-Jun-07 6:41 
GeneralRe: Throughput/Design Problem Pin
pbraun28-Jun-07 11:26
pbraun28-Jun-07 11:26 
Sounds to me like you have a good handle on what you need to do, but are not certain about the details.

What I perceive that you need is this:

1. You need to declare a class available AutoResetEvent.
2. You need to declare a dynamic list of some sort. In this case Queue would work perfectly.
3. You need to set up a thread that runs when this thread becomes signaled.
4. In your notify event handler do two things,
A. Put the incoming data block/message onto the queue.
B. Signal the autoresetevent that there is data to process.

In your data processing thread, make sure that it runs until all items on the queue are processed before returning to wait for the next signal.

As for locking, use a synchronized queue. That way the locking is done for you. If you're worried that locking the queue will cause the notification method to take too long, then you are not using locks properly. You should only lock the queue when you are adding to it or removing from it. Otherwise there should be no need to lock.

Uhm, yeah I spent 6 years dealing with a very similar situation.

Hopefully this helps.

Phil
GeneralRe: Throughput/Design Problem Pin
tobriain28-Jun-07 11:34
tobriain28-Jun-07 11:34 
GeneralRe: Throughput/Design Problem Pin
tobriain2-Jul-07 9:36
tobriain2-Jul-07 9:36 
GeneralRe: Throughput/Design Problem Pin
pbraun3-Jul-07 5:48
pbraun3-Jul-07 5:48 
GeneralRe: Throughput/Design Problem Pin
tobriain28-Jun-07 6:43
tobriain28-Jun-07 6:43 
GeneralRe: Throughput/Design Problem Pin
led mike28-Jun-07 7:00
led mike28-Jun-07 7:00 
Questionthe underscore character in front of a variable Pin
brsecu28-Jun-07 4:54
brsecu28-Jun-07 4:54 
AnswerRe: the underscore character in front of a variable Pin
Luc Pattyn28-Jun-07 4:56
sitebuilderLuc Pattyn28-Jun-07 4:56 
JokeRe: the underscore character in front of a variable Pin
CPallini28-Jun-07 5:14
mveCPallini28-Jun-07 5:14 
QuestionFileSystem based Collection (Queue) Pin
BaraMustafa28-Jun-07 4:53
BaraMustafa28-Jun-07 4:53 
AnswerRe: FileSystem based Collection (Queue) Pin
DanB198328-Jun-07 11:23
DanB198328-Jun-07 11:23 
AnswerRe: FileSystem based Collection (Queue) Pin
pbraun28-Jun-07 11:47
pbraun28-Jun-07 11:47 
QuestionWord.ApplicationClass Pin
Civic0628-Jun-07 4:44
Civic0628-Jun-07 4:44 
AnswerRe: Word.ApplicationClass Pin
Luc Pattyn28-Jun-07 4:54
sitebuilderLuc Pattyn28-Jun-07 4:54 
QuestionHow does non-blocking file access work? Pin
martin_hughes28-Jun-07 4:30
martin_hughes28-Jun-07 4:30 
AnswerRe: How does non-blocking file access work? Pin
Luc Pattyn28-Jun-07 5:02
sitebuilderLuc Pattyn28-Jun-07 5:02 
GeneralRe: How does non-blocking file access work? Pin
martin_hughes28-Jun-07 7:17
martin_hughes28-Jun-07 7:17 
QuestionMultiple selection in a datagrid Pin
-spy-28-Jun-07 4:14
-spy-28-Jun-07 4:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.