Thread: Multiple theads to process video files

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    20

    Question Multiple theads to process video files

    I define an array of a structs. This function runs as its own thread to process firewire video frames; ring buffer: thread per frame. In the function, I fill the array with frame information. This program starts & stops filling the array, at the starting and stopping points, dwStart & dwStop. Depending on the value of the boolean variables, set by a LED flash in the video frame, the program will write, in another thread, so it doesn't mess up the timing of the thread from which it was spawned, the array values out to a file. It looks something like...
    Code:
    for(int k = dwStart; k < dwStop; ++k){
    OutFile << setw(6) << frame[k].Frame << setw(12) << frame[k].FrameTime << setw(12) << frame[k].ldDuration << "\n";  
    }
    Sometimes, the last line of the information I write out is incomplete; frame number, but not the frame time or duration. Is the thread to write out begining while the (n+1) thread(frame) is in the process of fill the struct?

    How could I debug this? ......hummmm

    Thanks,
    Matt
    Last edited by Salem; 07-15-2005 at 03:01 PM. Reason: Defonted to restore sanity to the code tags

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. header files and multiple files
    By Dedalus in forum C Programming
    Replies: 5
    Last Post: 06-16-2009, 09:21 AM
  2. unable to process multiple files
    By ss_ss in forum C Programming
    Replies: 4
    Last Post: 05-28-2009, 02:04 AM
  3. Replies: 5
    Last Post: 02-25-2008, 06:35 AM
  4. Opening Multiple Files in sequence
    By wujiajun in forum C++ Programming
    Replies: 7
    Last Post: 01-16-2006, 08:47 PM
  5. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 02:41 PM