1
0
mirror of https://github.com/simh/simh.git synced 2026-01-25 11:46:37 +00:00

VIDEO: Added priority boost to thread performing SDL processing and updates

Reworked all priority adjustment code to leverage a new
sim_os_set_thread_priority API which is coded to use pthreads or OS
priority adjustment APIs as necessary.
This commit is contained in:
Mark Pizzolato
2016-06-11 09:52:33 -07:00
parent 3743d3d68a
commit a24aba69ae
9 changed files with 114 additions and 63 deletions

View File

@@ -216,16 +216,12 @@ static void *
_tape_io(void *arg)
{
UNIT* volatile uptr = (UNIT*)arg;
int sched_policy;
struct sched_param sched_priority;
struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
/* Boost Priority for this I/O thread vs the CPU instruction execution
thread which in general won't be readily yielding the processor when
this thread needs to run */
pthread_getschedparam (pthread_self(), &sched_policy, &sched_priority);
++sched_priority.sched_priority;
pthread_setschedparam (pthread_self(), sched_policy, &sched_priority);
sim_os_set_thread_priority (PRIORITY_ABOVE_NORMAL);
sim_debug (ctx->dbit, ctx->dptr, "_tape_io(unit=%d) starting\n", (int)(uptr-ctx->dptr->units));