[debug] Give debug_watcher maximum priority
authorRyan Dahl <ry@tinyclouds.org>
Wed, 17 Feb 2010 03:34:42 +0000 (19:34 -0800)
committerRyan Dahl <ry@tinyclouds.org>
Wed, 17 Feb 2010 03:45:12 +0000 (19:45 -0800)
src/node.cc
src/node.js

index 9646513..c24ecd3 100644 (file)
@@ -1156,6 +1156,7 @@ int main(int argc, char *argv[]) {
     // - which will give V8 control so it can handle whatever new message
     // had been received on the debug thread.
     ev_async_init(&node::debug_watcher, node::DebugMessageCallback);
+    ev_set_priority(&node::debug_watcher, EV_MAXPRI);
     // Set the callback DebugMessageDispatch which is called from the debug
     // thread.
     Debug::SetDebugMessageDispatchHandler(node::DebugMessageDispatch);
index af4856b..905757c 100644 (file)
@@ -351,7 +351,8 @@ var events = eventsModule.exports;
 
 var nextTickQueue = [];
 var nextTickWatcher = new process.IdleWatcher();
-nextTickWatcher.setPriority(process.EVMAXPRI); // max priority
+// Only debugger has maximum priority. Below that is the nextTickWatcher.
+nextTickWatcher.setPriority(process.EVMAXPRI-1);
 
 nextTickWatcher.callback = function () {
   var l = nextTickQueue.length;