[RESOLVED] Multiple Threads wait for eachother
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: [RESOLVED] Multiple Threads wait for eachother

  1. #1
    Join Date
    Mar 2011
    Posts
    2

    [RESOLVED] Multiple Threads wait for eachother

    Hi,

    I have a windows application with 3 threads. Each thread is required to continuously capture images from separate cameras, then 2 of the threads will go on to perform image processing, whilst no image processing is required from the 3rd. All images need to be captured at the same time, which is why I have 3 threads.

    I have a problem where I am unsure of the best way to synchronize these threads to ensure they capture at the same time. Ideally I would like each thread to wait until all threads have completed processing until capturing the next round of images. I could use shared variables to indicate when each thread is complete, but would like to use a thread synchronization method (like mutex) if there is one suitable.

    Any help is much appreciated,

    Stuart

  2. #2
    Join Date
    Jul 2005
    Location
    Netherlands
    Posts
    1,999

    Re: Multiple Threads wait for eachother

    Sounds like you are looking for a barrier. Have a look at http://www.boost.org/doc/libs/1_46_1...ation.barriers
    Cheers, D Drmmr

    Please put [code][/code] tags around your code to preserve indentation and make it more readable.

    As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky

  3. #3
    Join Date
    Mar 2011
    Posts
    2

    Re: Multiple Threads wait for eachother

    Spot on. Thanks D_Drmmr

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center