Browse Source

add 2 new API functions: jack_client_real_time_priority() and jack_client_max_real_time_priority(); client threads now run *5* below the engine to allow for the possibility of other client-specific threads to have priorities above the normal client thread but below the server; bump to 0.115.0 to reflect this change

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@3051 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.115.6
paul 16 years ago
parent
commit
a27a920f7c
5 changed files with 52 additions and 3 deletions
  1. +2
    -2
      configure.ac
  2. +1
    -0
      jack/internal.h
  3. +16
    -0
      jack/thread.h
  4. +12
    -1
      jackd/engine.c
  5. +21
    -0
      libjack/thread.c

+ 2
- 2
configure.ac View File

@@ -16,8 +16,8 @@ dnl micro version = incremented when implementation-only
dnl changes are made
dnl ---
JACK_MAJOR_VERSION=0
JACK_MINOR_VERSION=114
JACK_MICRO_VERSION=3
JACK_MINOR_VERSION=115
JACK_MICRO_VERSION=0

dnl ---
dnl HOWTO: updating the jack protocol version


+ 1
- 0
jack/internal.h View File

@@ -180,6 +180,7 @@ typedef struct {
int8_t do_mlock;
int8_t do_munlock;
int32_t client_priority;
int32_t max_client_priority;
int32_t has_capabilities;
float cpu_load;
float xrun_delayed_usecs;


+ 16
- 0
jack/thread.h View File

@@ -37,6 +37,22 @@ extern "C" {
* handling of realtime scheduling and associated privileges.
*/

/**
* @returns if JACK is running with realtime scheduling, this returns
* the priority that any JACK-created client threads will run at.
* Otherwise returns -1.
*/

int jack_client_real_time_priority (jack_client_t*);

/**
* @returns if JACK is running with realtime scheduling, this returns
* the maximum priority that a JACK client thread should use if the thread
* is subject to realtime scheduling. Otherwise returns -1.
*/

int jack_client_max_real_time_priority (jack_client_t*);

/**
* Attempt to enable realtime scheduling for a thread. On some
* systems that may require special privileges.


+ 12
- 1
jackd/engine.c View File

@@ -1843,9 +1843,20 @@ jack_engine_new (int realtime, int rtpriority, int do_mlock, int do_unlock,

engine->control->port_max = engine->port_max;
engine->control->real_time = realtime;
/* leave some headroom for other client threads to run
with priority higher than the regular client threads
but less than the server. see thread.h for
jack_client_real_time_priority() and jack_client_max_real_time_priority()
which are affected by this.
*/

engine->control->client_priority = (realtime
? engine->rtpriority - 1
? engine->rtpriority - 5
: 0);
engine->control->max_client_priority = (realtime
? engine->rtpriority - 1
: 0);
engine->control->do_mlock = do_mlock;
engine->control->do_munlock = do_unlock;
engine->control->cpu_load = 0;


+ 21
- 0
libjack/thread.c View File

@@ -198,6 +198,26 @@ jack_client_create_thread (jack_client_t* client,
return 0;
}

int
jack_client_real_time_priority (jack_client_t* client)
{
if (!client->engine->real_time) {
return -1;
}
return client->engine->client_priority;
}

int
jack_client_max_real_time_priority (jack_client_t* client)
{
if (!client->engine->real_time) {
return -1;
}

return client->engine->max_client_priority;
}

#if JACK_USE_MACH_THREADS

int
@@ -256,3 +276,4 @@ jack_acquire_real_time_scheduling (pthread_t thread, int priority)
}

#endif /* JACK_USE_MACH_THREADS */


Loading…
Cancel
Save