.net threads

N

nbencivenni

Hi everybody,
I'm writing an application that receives video frame from a camera that
releases a GotFrame event carrying the image as event argument 25 times
per second.
I wrote an event handler FrameReceiver hooked to the GotFrame event
that has to process the frame.
The main problem is that the frame processing rate can be lower than
the camera frame rate (depending on the system load) and the camera
releases its events on different threads.
I would like:
1) That the differnet threads that process the frames do not overlap
each other and do mantain the order they are released from the camera
2) If the recevier is busy processing one frame it should dismiss
future GotFrame events or (better) enqueue them in a N position FIFO
queue to be processed later on.

I'm knew with multi thread programming and any help would be
appreciate.
Regards,
Marco
 
N

nbencivenni

Hi Vadym,
thank you for your hint but I still have a doubt
This can be achieved via queue, threads may finish work in different order, but if requests >are queued the order can be preserved.
Access to queue must be made thread-safe ( e.g monitor or mutex )

How can I enque threads so that the order is preserved?
Thank you again for the time you spent answering.
regards,
Marco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top