DEV Community

Cover image for Inside Node.Js I/O
Rwik Mukhopadhyay
Rwik Mukhopadhyay

Posted on

1

Inside Node.Js I/O

Node.Js introduces iteslf as a asynchronous event driven javascript runtime. To acheive this asynchronous nature , node uses a open source library called libuv.

libuv even though built for Node , it is not exclusive to Node.js. There are plenty of other projects which uses libuv.

While network i/o is asynchronous , same can't be said for disk i/o .
libuv uses single threaded operation to use event loop and produce asynchronus network i/o . Mostly lib pool apis are not thread safe as it is designed to work in single threaded mode only.

Disk i/o has some platform specific differences . Every majore APIs for disk I/O has it's own limitations, also this increases complexity. So libuv uses blocking disk operations using thread pool.

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay