Small change in the non-WIN32 Voodoo2 thread code: Process all complete command

packets and then always sleep for 1 millisecond.
TODO: The first tests with pthread_cond_* stuff showed a slowdown of approx.
10 % compared with the IPS value of the current code.
This commit is contained in:
Volker Ruppert 2017-08-09 15:42:34 +00:00
parent 3cee1f74ee
commit 593141603d

View File

@ -164,17 +164,17 @@ BX_THREAD_FUNC(cmdfifo_thread, indata)
{
UNUSED(indata);
while (1) {
#ifndef WIN32
while (!v->fbi.cmdfifo[0].enable || (v->fbi.cmdfifo[0].depth < v->fbi.cmdfifo[0].depth_needed)) {
BX_MSLEEP(1);
}
cmdfifo_process();
#else
#ifdef WIN32
if (WaitForSingleObject(v->fbi.cmdfifo[0].event, 1) == WAIT_OBJECT_0) {
while (v->fbi.cmdfifo[0].enable && (v->fbi.cmdfifo[0].depth >= v->fbi.cmdfifo[0].depth_needed)) {
cmdfifo_process();
}
}
#else
while (v->fbi.cmdfifo[0].enable && (v->fbi.cmdfifo[0].depth >= v->fbi.cmdfifo[0].depth_needed)) {
cmdfifo_process();
}
BX_MSLEEP(1);
#endif
}
BX_THREAD_EXIT;