Browse Source

[engine] relax the rules for zombification

we now give a client which didnt finish, a bit more time to complete
its process_cb. this should prevent most cases of unjustified client
zombification.

however we can get streams of xruns, because we can overload the
cpu now.

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@4428 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.121.0
torben 14 years ago
parent
commit
b7eed771d1
1 changed files with 18 additions and 3 deletions
  1. +18
    -3
      jackd/clientengine.c

+ 18
- 3
jackd/clientengine.c View File

@@ -33,6 +33,7 @@
#include <jack/engine.h>
#include <jack/messagebuffer.h>
#include <jack/version.h>
#include <jack/driver.h>
#include <sysdeps/poll.h>
#include <sysdeps/ipc.h>

@@ -269,9 +270,23 @@ jack_check_clients (jack_engine_t* engine, int with_timeout_check)
if (client->control->awake_at > 0) {
if (client->control->finished_at == 0) {
client->control->timed_out++;
client->error++;
VERBOSE (engine, "client %s has timed out", client->control->name);
jack_time_t now = jack_get_microseconds();

if ((now - client->control->awake_at) < engine->driver->period_usecs) {
/* we give the client a bit of time, to finish the cycle
* we assume here, that we dont get signals delivered to this thread.
*/
struct timespec wait_time;
wait_time.tv_sec = 0;
wait_time.tv_nsec = engine->driver->period_usecs - (now - client->control->awake_at);
nanosleep (&wait_time, NULL);
}

if (client->control->finished_at == 0) {
client->control->timed_out++;
client->error++;
VERBOSE (engine, "client %s has timed out", client->control->name);
}
}
}
}


Loading…
Cancel
Save