J
jiing
bool foundOrNot = 0;
while (! foundOrNot){
// from here do some calculations here
......
......
// till here
foundOrNot = doSomeWastingTimeThing(); // 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 doSomewastingTimeThing( ) will spend us a lot of
time.
We want to do the other things till doSomeWastingTimeThing get the
return value (foundOrNot).
When doSomeWastingTimeThing 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-
while (! foundOrNot){
// from here do some calculations here
......
......
// till here
foundOrNot = doSomeWastingTimeThing(); // 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 doSomewastingTimeThing( ) will spend us a lot of
time.
We want to do the other things till doSomeWastingTimeThing get the
return value (foundOrNot).
When doSomeWastingTimeThing 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-