Questions tagged [libuv]

libuv is a platform layer for Node written in C. Its purpose is to abstract IOCP on Windows and libev-like functionality on Unix systems.

libuv is a platform layer for node.js written in C. Its purpose is to abstract IOCP on Windows and libev on Unix systems. It is intended to eventually contain all platform differences in this library.

400 questions
10
votes
1 answer

libuv: how to gracefully exit application on an error?

I have an application which uses libuv library. it runs default loop: uv_run(uv_default_loop()); How can the application be gracefully exited in case of a failure? Currently I am doing it like in the following example: uv_tcp_t* tcp =…
Andrei Sedoi
  • 1,534
  • 1
  • 15
  • 28
10
votes
3 answers

libuv allocated memory buffers re-use techniques

i am using libuv for my extensively-network-interacting application and i am concerned about which techniques of re-using allocated memory would be at the same time efficent and safe with libuv callback deferrence of execution. At very basic layer,…
Alexander Tumin
  • 1,561
  • 4
  • 22
  • 33
10
votes
4 answers

Closing libUV Handles Correctly

I'm trying to find out how to fix these memory leaks I'm getting while running this program with Valgrind. The leaks occur with the two allocations in nShell_client_main. But I'm not sure how to properly free them. I've tried freeing them at…
tay10r
  • 4,234
  • 2
  • 24
  • 44
9
votes
4 answers

How does the libuv implementation of *non-blockingness* work exactly?

So I have just discovered that libuv is a fairly small library as far as C libraries go (compare to FFmpeg). I have spent the past 6 hours reading through the source code to get a feel for the event loop at a deeper level. But still not seeing where…
Lance
  • 75,200
  • 93
  • 289
  • 503
9
votes
2 answers

How to install libuv on ubuntu?

sudo apt-get install libuv $ sudo apt-get install libuv [sudo] username ... It fails to find package and install. Is libuv included in some other packages?
Hind Forsum
  • 9,717
  • 13
  • 63
  • 119
9
votes
2 answers

libuv uses blocking file system calls internally – Why? How?

I just learned that Node.js crown jewel libuv uses blocking system calls for file operations. The asynchronous behavior is implemented with threads! That raises two questions (I only care about Unix): Why is it not using the non-blocking filesystem…
Robert Siemer
  • 32,405
  • 11
  • 84
  • 94
8
votes
1 answer

Does the .pipe() perform a memcpy in node.js?

This is a conceptual query regarding system level optimisation. My understanding by reading the NodeJS Documentation is that pipes are handy to perform flow control on streams. Background: I have microphone stream coming in and I wanted to avoid an…
Ashish
  • 595
  • 4
  • 12
8
votes
1 answer

How does the UV_RUN_NOWAIT mode work in libuv?

When running an event loop in libuv using the uv_run function, there's a "mode" parameter that is used with the following values: UV_RUN_DEFAULT UV_RUN_ONCE UV_RUN_NOWAIT The first two are obvious. UV_RUN_DEFAULT runs the event loop until there are…
Alexis King
  • 43,109
  • 15
  • 131
  • 205
7
votes
3 answers

In node js, what is libuv and does it use all core?

As far as I know, all IO requests and other asynchronous tasks are done by libuv in nodejs. I want to know if libuv is using threading. If it is, is it using all available core or not?
Rishabh
  • 185
  • 1
  • 13
7
votes
2 answers

libuv worker threads or work queue health check?

In libuv, you can end up tying up the worker threads with too much work or buggy code. Is there a simple function that can check the health of the worker threads or thread queue? It doesn't have to be 100% deterministic, after all it would be…
Glen Low
  • 4,379
  • 1
  • 30
  • 36
7
votes
2 answers

Network Library for server side of a mmorpg (libuv/boost::asio?)

I am currently rewriting the server side of a very old mmorpg, and I was looking for a good opensource network library to use with C/C++. As the client already exists, I can't use any library that enforces some kind of packet structure or…
RenatoUtsch
  • 1,449
  • 1
  • 13
  • 20
6
votes
2 answers

Does Node Js use libuv Thread Pool for Network I/O

I am learning Node.js I have found this note on libuv official documentation- “ libuv uses a thread pool to make asynchronous file I/O operations possible, but network I/O is always performed in a single thread, each loop’s thread.” My question is…
Dhairya Lakhera
  • 4,445
  • 3
  • 35
  • 62
6
votes
1 answer

libuv vs sockets in asp.net core 2.1

As of ASP.NET Core 2.1.0-preview2 Microsoft has changed libuv to sockets. Why haven't they used Sockets in the first place? Is there a same implication of sockets in every operating system? Is sockets are faster then libuv? this is the source
Code OverFlow
  • 913
  • 1
  • 13
  • 28
6
votes
1 answer

Get a count of (active) timers in Node.js event loop

Is there a way to make a call in Node.js to determine the number of timers in the event loop queue? I have a library with a number of timeouts and instead of keeping track of them myself using some sort of internal bookkeeping system, it would be…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
6
votes
3 answers

dnx kestrel "System.EntryPointNotFoundException: uv_loop_size"

I'm trying to run an unmodified Web Api application created by yo aspnet. I'm getting this error: System.EntryPointNotFoundException: uv_loop_size at (wrapper managed-to-native)…
AndyD
  • 5,252
  • 35
  • 32
1
2
3
26 27