Hi,
I am using the following spinlock approach:
while(!hasPerformedAction()){
//wait for the user to perform the action
//can add timer here too
}
setHasPerformedAction(false);
return getActionPerfomed();
this basically waits for a user to perform an action and then returns it. Currently something requests an answer from the user before continuing, this is why I wait until input is received. However I was wondering if this is inefficient and if we are waiting for a while (i.e. <= 30 secs) will it slow down the pc that is running this app. Are there any other alternatives using this approach i.e. locks, semaphores if so what is the syntax?
Thanks,
Aly