The only way you can cantinue processing a function after calling another function is if the calling function does not rely on a return value from the called function. In cases like that, you are almost universally talking about another subsystem to the game than the calling function resides in, which would be on another thread any way for optimization.
The instances of long, intensive functions with no return value, and no variables passed by refference is extrordinarily low. They are usually short functions that should probably be inlined any way.
The actual function call on the core won't be any faster than a standard function call any way. You will need to push the variables to some data structure in memory (probably the stack for that core) and push the return value back to the calling core (stack again)
You will have to set the function pointer on the called core to the proper function as well.
the only thing that wouldn't need to be done would be to have the calling function's call memory location pushed and popped off the stack. You would have some sort of memory write/read to tell when the return variable is ready, so there is no speed up when calling a function on a separate core than a standard core.
I don't see how mulitple cores could possibly speed up the following
int funa(int a, int b, int c)
{
int x = funb(a,b);
int y = func(c,x);
int z = fund(y,a)
return z;
}
I am a Gauntlet Adventurer. I strive to improve my living conditions by hoarding gold, food, and sometimes keys and potions. I love adventure, fighting, and particularly winning - especially when there's a prize at stake. I occasionally get lost inside buildings and can't find the exit. I need food badly. What Video Game Character Are You? |
Mega Man 9 Challenges: 74%
Waltz | Tango | Jitterbug | Bust a move | Headbanging |
Bunny Hop | Mr. Trigger Happy | Double Trouble | Mr. Perfect | Invincible |
Almost Invincible | No Coffee Break | Air Shoes | Mega Diet | Encore |
Peacekeeper | Conservationist | Farewell To Arms | Gamer's Day | Daily Dose |
Whomp Wiley! | Truly Addicted! | Truly Hardcore! | Conqueror | Vanquisher |
Destroyer | World Warrior | Trusty Sidearm | Pack Rat | Valued Customer |
Shop A Holic | Last Man Standing | Survivor | Hard Rock | Heavy Metal |
Speed Metal | Fantastic 9 | Fully Unloaded | Blue Bomber | Eco Fighter |
Marathon Fight | Quick Draw G | Quick Draw C | Quick Draw S | Quick Draw H |
Quick Draw J | Quick Draw P | Quick Draw T | Quick Draw M | Quick Draw X |