Skip to content

Commit

Permalink
Remove eio_warmup. Use ev_ref instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Jun 22, 2009
1 parent cc67d8e commit f56309d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
3 changes: 1 addition & 2 deletions src/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ using namespace node;
Local<Function> l = Local<Function>::Cast(last_arg); \
callback = new Persistent<Function>(); \
*callback = Persistent<Function>::New(l); \
} \
node::eio_warmup(); \
}

#define CALL_CALLBACK_PTR(req, argc, argv) \
do { \
Expand Down
4 changes: 1 addition & 3 deletions src/net.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 2 additions & 13 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<Value> encoding_v)
{
Expand Down Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ do { \
enum encoding {ASCII, UTF8, RAW};
enum encoding ParseEncoding (v8::Handle<v8::Value> encoding_v);
void FatalException (v8::TryCatch &try_catch);
void eio_warmup (void); // call this before creating a new eio event.

class ObjectWrap {
public:
Expand Down

0 comments on commit f56309d

Please sign in to comment.