Hi everyone,
In the code I've see that there are a few while loops checking conditions and calling sleep(0) to avoid use all cpu cycles. Does anyone have tried to use signals ?
I've run dolphin with callgrind (from valgrind) and the emulator waste a considerable amount of cpu cycles on those loops.
Example:
could be replace with something like (with the corresponding setters and getters):
Regards,
In the code I've see that there are a few while loops checking conditions and calling sleep(0) to avoid use all cpu cycles. Does anyone have tried to use signals ?
I've run dolphin with callgrind (from valgrind) and the emulator waste a considerable amount of cpu cycles on those loops.
Example:
Code:
while (!CommandProcessor::interruptWaiting && fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance > fifo.CPLoWatermark && !AtBreakpoint()) Common::YieldCPU();
could be replace with something like (with the corresponding setters and getters):
Code:
while (CommandProcessor::getInterruptWaiting() == false && fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance > fifo.CPLoWatermark && !AtBreakpoint()){
pthread_cond_wait(&signal_cond, &signal_mtx);
}
Regards,