472,991 Members | 2,986 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,991 software developers and data experts.

.net threads

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

May 22 '06 #1
2 1069
Have you thought os using buffering? With buffering, you save the frames for
a period of time, and then begin displaying them at such a rate that the
client will never run out of frames to display. That way, the frames are
displayed at the rate they were created. If, for some reason, the client
catches up with the camera, you simply stop the client and re-buffer.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

The man who questions opinions is wise.
The man who quarrels with facts is a fool.

<nb*********@gmail.com> wrote in message
news:11*********************@y43g2000cwc.googlegro ups.com...
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

May 22 '06 #2
hB
Follow the technique specified here by Kevin Spencer.
And Have two threads.

One Thread - MasterThread -> Receives the events
And put the data/images in the buffer.

Other Thread -> Checks the buffer for Input data/images to process.
Process them one by one in the order data/images put-in by master
thread.
And when processes remove them from buffer.

Use any thread safe buffer mechanism of DotNet.

---
hB

May 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ronan Viernes | last post by:
Hi, I have created a python script (see below) to count the maximum number of threads per process (by starting new threads continuously until it breaks). ###### #testThread.py import...
0
by: Al Tobey | last post by:
I was building perl 5.8.2 on RedHat Enterprise Linux 3.0 (AS) today and noticed that it included in it's ccflags "-DTHREADS_HAVE_PIDS." I am building with -Dusethreads. With newer Linux...
6
by: m | last post by:
Hello, I have an application that processes thousands of files each day. The filenames and various related file information is retrieved, related filenames are associate and placed in a linked...
34
by: Kovan Akrei | last post by:
Hi, I would like to know how to reuse an object of a thread (if it is possible) in Csharp? I have the following program: using System; using System.Threading; using System.Collections; ...
3
by: bygandhi | last post by:
Hi - I am writing a service which will check a process and its threads for their state ( alive or dead ). The process has 5 .net managed threads created using thread.start and each have been...
10
by: [Yosi] | last post by:
I would like to know how threads behavior in .NET . When an application create 4 threads for example start all of them, the OS task manager will execute all 4 thread in deterministic order manes,...
6
by: RahimAsif | last post by:
Hi guys, I would like some advice on thread programming using C#. I am writing an application that communicates with a panel over ethernet, collects data and writes it to a file. The way the...
3
by: mjheitland | last post by:
Hi, I like to know how many threads are used by a Threading.Timer object. When I create a Threading.Timer object calling a short running method every 5 seconds I expected to have one additional...
10
by: Darian | last post by:
Is there a way to find all the thread names that are running in a project? For example, if I have 5 threads T1, T2, T3, T4, T5...and T2, T4, and T5 are running...I want to be able to know that...
4
by: tdahsu | last post by:
All, I'd appreciate any help. I've got a list of files in a directory, and I'd like to iterate through that list and process each one. Rather than do that serially, I was thinking I should...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.