For example having an array or reader threads and one writer thread we can sinc tham like this via shared_mutex and shared_lock this works if we are not dependent on time. But if we want to get all writing operations done inside of certan time frame and if thay are not done stop waiting and start doing something else inside of reader threads. How to do such thing? How to be capable to say from some watcher thread to all readers threads – “hey guys – there wount be any new data from writer in this time frame so go on.”
Share
Use a timed lock.
Just pick a timeout value. Note that it won’t necessarily be precise.
BTW: if you’re going to use Boost.Threads, perhaps you should read the documentation. It’s pretty extensive. I’ve never used Boost.Threads, and it took me a matter of seconds to find this.