From f56309deee758d7b113107d26cec20930f35966b Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 22 Jun 2009 19:32:42 +0200 Subject: [PATCH] Remove eio_warmup. Use ev_ref instead. --- src/file.cc | 3 +-- src/net.cc | 4 +--- src/node.cc | 15 ++------------- src/node.h | 1 - 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/file.cc b/src/file.cc index fc8af092a2..a8f7d4c1bf 100644 --- a/src/file.cc +++ b/src/file.cc @@ -34,8 +34,7 @@ using namespace node; Local l = Local::Cast(last_arg); \ callback = new Persistent(); \ *callback = Persistent::New(l); \ - } \ - node::eio_warmup(); \ + } #define CALL_CALLBACK_PTR(req, argc, argv) \ do { \ diff --git a/src/net.cc b/src/net.cc index dc57992977..07c8f743f8 100644 --- a/src/net.cc +++ b/src/net.cc @@ -222,12 +222,10 @@ Connection::Connect (const Arguments& args) Connection::Resolve(req); #else /* For the moment I will do DNS lookups in the eio thread pool. This is - * sub-optimal and cannot handle massive numbers of requests but it is - * quite portable. + * sub-optimal and cannot handle massive numbers of requests. * In the future I will move to a system using adns or udns: * http://lists.schmorp.de/pipermail/libev/2009q1/000632.html */ - eio_warmup(); connection->Attach(); eio_custom( Connection::Resolve , EIO_PRI_DEFAULT diff --git a/src/node.cc b/src/node.cc index 6036e158b8..5b0c2ab591 100644 --- a/src/node.cc +++ b/src/node.cc @@ -227,13 +227,6 @@ static void node_eio_cb (EV_P_ ev_async *w, int revents) { int r = eio_poll(); - /* returns 0 if all requests were handled, -1 if not, or the value of EIO_FINISH if != 0 */ - - // XXX is this check too heavy? - // it require three locks in eio - // what's the better way? - if (eio_nreqs () == 0 && eio_nready() == 0 && eio_npending() == 0) - ev_async_stop(EV_DEFAULT_UC_ w); } static void @@ -242,12 +235,6 @@ eio_want_poll (void) ev_async_send(EV_DEFAULT_UC_ &eio_watcher); } -void -node::eio_warmup (void) -{ - ev_async_start(EV_DEFAULT_UC_ &eio_watcher); -} - enum encoding node::ParseEncoding (Handle encoding_v) { @@ -349,6 +336,8 @@ main (int argc, char *argv[]) // start eio thread pool ev_async_init(&eio_watcher, node_eio_cb); eio_init(eio_want_poll, NULL); + ev_async_start(EV_DEFAULT_UC_ &eio_watcher); + ev_unref(EV_DEFAULT_UC); V8::SetFlagsFromCommandLine(&argc, argv, true); V8::Initialize(); diff --git a/src/node.h b/src/node.h index af376adc4c..5311b479f5 100644 --- a/src/node.h +++ b/src/node.h @@ -29,7 +29,6 @@ do { \ enum encoding {ASCII, UTF8, RAW}; enum encoding ParseEncoding (v8::Handle encoding_v); void FatalException (v8::TryCatch &try_catch); -void eio_warmup (void); // call this before creating a new eio event. class ObjectWrap { public: