bool foundOrNot = 0;
while (! foundOrNot){
// from here do some calculations here
......
......
// till here
foundOrNot = doSomeWastingTi meThing(); // This function will spend
a lot of time to get the answer of returnValue
// do some other calculations here, for example
......
......
......
// till here
}
Since we know that doSomewastingTi meThing( ) will spend us a lot of
time.
We want to do the other things till doSomeWastingTi meThing get the
return value (foundOrNot).
When doSomeWastingTi meThing return the answer, we begin to do something
about the returned answer.
Now, my question is:
1. How can I do it in C Language? Could you show me some valid code?
My friend told me that I may use a call back function or thread to
achieve it. But he never did that before.
Could someone guide me to the right direction or give me some url or
examples?
Thanks in advance.
-jiing-
Comment