Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8099081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:17:08+00:00 2026-06-05T22:17:08+00:00

Are there internally two event loops in nodejs architecture? libev/libuv v8 javascript event loop

  • 0

Are there internally two event loops in nodejs architecture?

  • libev/libuv
  • v8 javascript event loop

On an I/O request does node queue the request to libeio which in turn notifies the availability of data via events using libev and finally those events are handled by v8 event loop using callbacks?

Basically, How are libev and libeio integrated in nodejs architecture?

Are there any documentation available to give a clear picture of nodejs internal architecture?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:17:12+00:00Added an answer on June 5, 2026 at 10:17 pm

    I have been personally reading the source code of node.js & v8.

    I went into a similar problem like you when I tried to understand node.js architecture in order to write native modules.

    What I am posting here is my understanding of node.js and this might be a bit off track as well.

    1. Libev is the event loop which actually runs internally in node.js to perform simple event loop operations. It’s written originally for *nix systems. Libev provides a simple yet optimized event loop for the process to run on. You can read more about libev here.

    2. LibEio is a library to perform input output asynchronously. It handles file descriptors, data handlers, sockets etc. You can read more about it here here.

    3. LibUv is an abstraction layer on the top of libeio , libev, c-ares ( for DNS ) and iocp (for windows asynchronous-io). LibUv performs, maintains and manages all the io and events in the event pool. ( in case of libeio threadpool ). You should check out Ryan Dahl’s tutorial on libUv. That will start making more sense to you about how libUv works itself and then you will understand how node.js works on the top of libuv and v8.

    To understand just the javascript event loop you should consider watching these videos

    • JS-conference
    • JSConf2011 ( has very irritative sfx)
    • Understanding event driven programming
    • Understanding the node.js event loop

    To see how libeio is used with node.js in order to create async modules you should see this example.

    Basically what happens inside the node.js is that v8 loop runs and handles all javascript parts as well as C++ modules [ when they are running in a main thread ( as per official documentation node.js itself is single threaded) ]. When outside of the main thread, libev and libeio handle it in the thread pool and libev provide the interaction with the main loop. So from my understanding, node.js has 1 permanent event loop: that’s the v8 event loop. To handle C++ async tasks it’s using a threadpool [via libeio & libev ].

    For example:

    eio_custom(Task,FLAG,AfterTask,Eio_REQUEST);
    

    Which appears in all modules is usually calling the function Task in the threadpool. When it’s complete, it calls the AfterTask function in the main thread. Whereas Eio_REQUEST is the request handler which can be a structure / object whose motive is to provide communication between the threadpool and main thread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why in Boolean type there are two fields with the same value? internal const
There are load balanced tomcat web servers. Every request could be served by different
[continued from Is there a way to tell whether two COM interface references point
I have two tables: User and Event in a many-to-many relationship. For this I
I have a setup where two instances (A, B) is listening on a event
There are two implications of using the inline keyword(§ 7.1.3/4): It hints the compiler
Here's my problem: there's an internal issue tracking system that has a nice summary
There is an option to create Internal parameters in SSRS : In what context
Is there a way to execute internal code via reflection? Here is an example
Is there any official/unofficial/informal convention for alt+key namings ? maybe, Microsoft have some internal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.