Backslash
21st February 2008, 19:16
Hello everyone,
I'm working with a function that, for instance, does some task it it's own thread and takes the address of an int for progress. Like so:
void doSometing(int* progress)
So, While the function is off running, I need an efficient way to check the progress for completion so that I may process the next item. I was doing something like this:
while(progress < 100)
{
progressBar->value = progress
}
That just seems like a bit much. But if I only check it every, say, 10 seconds, I could conceivably be wasting 9 seconds for every item. So, is there an accepted way to do something like this?
Thanks for your time,
Backslash
I'm working with a function that, for instance, does some task it it's own thread and takes the address of an int for progress. Like so:
void doSometing(int* progress)
So, While the function is off running, I need an efficient way to check the progress for completion so that I may process the next item. I was doing something like this:
while(progress < 100)
{
progressBar->value = progress
}
That just seems like a bit much. But if I only check it every, say, 10 seconds, I could conceivably be wasting 9 seconds for every item. So, is there an accepted way to do something like this?
Thanks for your time,
Backslash