473,320 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 1082
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.