-
March 24th, 2011, 12:13 PM
#1
[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
-
March 24th, 2011, 05:00 PM
#2
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
-
March 25th, 2011, 05:01 AM
#3
Re: Multiple Threads wait for eachother
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|