Thread priority tweaks: Ensure renderer threads have higher priorities than the receive threads. Increase the priority of the resync thread to just below the video renderer so the control packet can be emitted ASAP. Lower the priority of the loss stats thread. Increase the priority of the input thread slightly above normal.

This commit is contained in:
Cameron Gutman 2014-10-17 17:03:58 -07:00
parent 8dbb03114d
commit 7f587dc389
4 changed files with 6 additions and 1 deletions

View File

@ -142,6 +142,7 @@ public class AudioStream {
}; };
threads.add(t); threads.add(t);
t.setName("Audio - Player"); t.setName("Audio - Player");
t.setPriority(Thread.NORM_PRIORITY + 2);
t.start(); t.start();
} }
@ -205,6 +206,7 @@ public class AudioStream {
}; };
threads.add(t); threads.add(t);
t.setName("Audio - Receive"); t.setName("Audio - Receive");
t.setPriority(Thread.NORM_PRIORITY + 1);
t.start(); t.start();
} }

View File

@ -252,7 +252,7 @@ public class VideoStream {
}; };
threads.add(t); threads.add(t);
t.setName("Video - Receive"); t.setName("Video - Receive");
t.setPriority(Thread.MAX_PRIORITY); t.setPriority(Thread.MAX_PRIORITY - 1);
t.start(); t.start();
} }

View File

@ -171,6 +171,7 @@ public class ControlStream implements ConnectionStatusListener {
} }
} }
}; };
lossStatsThread.setPriority(Thread.MIN_PRIORITY + 1);
lossStatsThread.setName("Control - Loss Stats Thread"); lossStatsThread.setName("Control - Loss Stats Thread");
lossStatsThread.start(); lossStatsThread.start();
@ -220,6 +221,7 @@ public class ControlStream implements ConnectionStatusListener {
} }
}; };
resyncThread.setName("Control - Resync Thread"); resyncThread.setName("Control - Resync Thread");
resyncThread.setPriority(Thread.MAX_PRIORITY - 1);
resyncThread.start(); resyncThread.start();
} }

View File

@ -186,6 +186,7 @@ public class ControllerStream {
} }
}; };
inputThread.setName("Input - Queue"); inputThread.setName("Input - Queue");
inputThread.setPriority(Thread.NORM_PRIORITY + 1);
inputThread.start(); inputThread.start();
} }