Skip to content

Commit

Permalink
Set low priority for dump watchers
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Nov 30, 2010
1 parent 347c1a7 commit a6ae4e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/node_io_watcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ void IOWatcher::Initialize(Handle<Object> target) {

ev_prepare_init(&dumper, IOWatcher::Dump);
ev_prepare_start(EV_DEFAULT_UC_ &dumper);
// Need to make sure that Dump runs *after* all other prepare watchers -
// in particular the next tick one.
ev_set_priority(&dumper, EV_MINPRI);
ev_unref(EV_DEFAULT_UC);

dump_queue = Persistent<Object>::New(Object::New());
Expand Down Expand Up @@ -200,10 +203,8 @@ Handle<Value> IOWatcher::Set(const Arguments& args) {
// 'build/c4che/default.cache.py' and
// make clean all
#ifdef DUMP_DEBUG
#define DEBUG_PRINT(fmt,...) do { \
fprintf(stderr, "%s:%d ", __FILE__, __LINE__); \
fprintf(stderr, fmt "\n", ##__VA_ARGS__); \
} while (0)
#define DEBUG_PRINT(fmt,...) \
fprintf(stderr, "%s:%d " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__)
#else
#define DEBUG_PRINT(fmt,...)
#endif
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-dumper2.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function test (N, size, cb) {
// Count the data as it arrives on the read end of the pipe.
stream.on('data', function (d) {
nread += d.length;
process.stdout.write(".");

if (nread >= expected) {
assert.ok(nread === expected);
Expand Down Expand Up @@ -88,6 +87,7 @@ function runTests (values) {

runTests([ [30, 1000]
, [4, 10000]
, [50, 1024*1024]
]);


Expand Down

0 comments on commit a6ae4e9

Please sign in to comment.