02-10-2014 02:27 PM
Hi,
I'm working on a project with up to 15 UUTs which are supposed to be running using the parallel model, since they have to be able to start and stop separately.
There are conditions in which all active UUTs are paused and restarted upon request. Communication with the UUTs is established using a single demon. Now I need a synchronization method, to make sure only one thread runs the daemons initialization. Just like a batch synchronization using the "One Thread Only" option.
The Batch steps do not work in the Parallel Model so is there a best practice establish a synchronization like this? I have some ideas, but I guess I'm thinking too complicated and can't see the wood for trees....
Cheers
Oli
02-10-2014 02:32 PM
Can you do something like this?
InitializeIfNeeded()
{
Lock("Initialization");
if (!initialized)
{
Initialize();
initialized = true;
}
Unlock("Initialization");
}
02-11-2014 01:38 AM
James,
thanks for the reply. I guess I can implement sth like you suggested. Was just wondering, if I'm missing some built in option that saves me from tinkering myself.
Cheers
Oli