Skip to content
0:00 / 0:00

#libuv#eventloop#asynchronousio

LXJS 2012 - Bert Belder - libuv

LXJS

951 subscribers • 1 video on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Bert Belder, Node.js core contributor

Advanced. Deep dive for people who know the field.

55K views14 years ago2 recommendations

Systems programmingProgramming languagesConcurrency and parallelismOperating systemsNode.js, Deno and Bun

Bert Belder explains the architecture of libuv and how it handles asynchronous I/O and the event loop in Node.js.

A 2-day not-for-profit by-the-community and for-the-community international conference about the New Worlds of JavaScript. Speaker: Bert Belder Node.js developer, Cloud9 IDE I've been programing since I was a little kid; my professional career started with doing contract web development work while I was in college. In 2011 I was working on a project that really needed node.js. But as all developers working on that project were using windows we were unable to use it, so I started porting it to windows as a side project. Soon after I was hired by Rackspace to dedicate all my time to node.js and finish the job. That was how I became one of the first node core contributors. Nowadays I am working at Cloud9 IDE in Amsterdam, who generously let me work on making node more awesome.

Why it's here

2 people recommend this

What people say. Recommended as a classic, clear explanation of how libuv and asynchronous I/O work under the hood in Node.js.

u/jwalton78in r/node • Recommends

On “Is nodejs single threaded or multi threaded”

Ignoring fancy things like worker threads, node.js is *mostly* single threaded. All of your javascript code executes on a single "event loop", all on the same thread. IO is still *mostly* single threaded. Node.js is based on a library called libuv which handles all the IO. In a language like Java or Golang, when you want to read from or write to a socket you'd do what's called "blocking" or "synchronous" IO - you'd call into a socket.write() function, and it would block until the data you asked it to write is written (or until some error happens). If you try to socket.read() and there's no data to read, it'll just block until there is some. But, blocking IO is not the only way to do IO…

u/tswatersin r/node • Recommends

On “How would I create a non-async function from strictly synchronous parts”

There is something deeper! Node is a combination of the node standard lib, the v8 js runtime & libuv bindings. libuv is the thing that is responsible for the async io work. Here's a pretty good video, short, descibes a bit how libuv works: [video \-- note that's for 2012 so some of it may be outdated? presenter mentioned node 0.4... seemed to match my limited understanding though.