1
General Discussion about just::thread / is it possible to tell a thread to wait without using a lock
« on: November 25, 2008, 01:55:35 AM »
I am not sure if I understand the unique_lock very well. I have this scenerio with the MT algorithm.
I have determined that there is no gain to the algorithm if the generate method has to initialize the threads every time before twisting the array[ 624 ].
I am taking an approach were the contructor creates the threads at the time that the CRandomMT is instantiated. I assign a block of the array to each thread. then I want each thread to stay running for the lifetime of the CRandomMT random number generator. I also want the threads to wait until I queue them to twist there block of the array. then once they are done wait again until they are queued to do it again.
each block of the array is isolated from another block of the array.
does a unique_lock provide this functionality or does it behave differently?
Kenneth
I have determined that there is no gain to the algorithm if the generate method has to initialize the threads every time before twisting the array[ 624 ].
I am taking an approach were the contructor creates the threads at the time that the CRandomMT is instantiated. I assign a block of the array to each thread. then I want each thread to stay running for the lifetime of the CRandomMT random number generator. I also want the threads to wait until I queue them to twist there block of the array. then once they are done wait again until they are queued to do it again.
each block of the array is isolated from another block of the array.
does a unique_lock provide this functionality or does it behave differently?
Kenneth