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
6
votes
2 answers

how libuv threads in nodejs utilize multi core cpu

I am not able to find out whether libuv in node.js uses multi core cpus or it runs all of its threads in on single core only using time slicing? As node.js is single threaded but libuv has its own thread pool so does it use all the cores of multi…
Praveen Pandey
  • 409
  • 3
  • 20
6
votes
1 answer

libuv - how to stop tcp server, which runs in another thread

For example i have 2 threads. I want to stop server from main thread (Thread 1). Thread 1: main program Thread 2: TcpServer From libuv library: /* * This function will stop the event loop by forcing uv_run to end * as soon as possible, but not…
Krab
  • 6,526
  • 6
  • 41
  • 78
6
votes
2 answers

libuv undefined reference to uv_loop_new

After compiling, I am trying to run libuv sample program: #include #include int main() { uv_loop_t *loop = uv_loop_new(); printf("Now quitting.\n"); uv_run(loop, UV_RUN_DEFAULT); return 0; } But, when try to…
Miroslav Trninic
  • 3,327
  • 4
  • 28
  • 51
5
votes
1 answer

Are libuv handles active after close but before close_cb?

libuv has a void uv_close(uv_handle_t* handle, uv_close_cb close_cb) method to close handles which takes a callback. As the title says, is the handle active (in terms of I/O) before close_cb is called? For example, can a UDP handle fire a receive…
Roshan
  • 1,937
  • 1
  • 13
  • 25
5
votes
1 answer

How to get fix for: Assertion failed: new_time >= loop->time

If a run my current nodejs project, it crashes as soon as FireStore is accessed (the problem started when I moved to a new Windows laptop): Assertion failed: new_time >= loop->time, file c:\ws\deps\uv\src\win\core.c, line 309 npm ERR! code…
Codo
  • 75,595
  • 17
  • 168
  • 206
5
votes
2 answers

What is __attribute__((unused)) static?

In libuv file heap-inl.h, I see the following macro #if defined(__GNUC__) # define HEAP_EXPORT(declaration) __attribute__((unused)) static declaration ... HEAP_EXPORT(void heap_init(struct heap* heap)); ... heap-inl.h is included in a source file…
richizy
  • 2,002
  • 3
  • 21
  • 26
5
votes
1 answer

Understanding libuv / epoll / non-blocking network IO

I am trying to understand how non-blocking network IO is working in Node.js/libuv. I already found out that file IO is done using libuv worker threads (thus, in a background thread). However it is stated in various places that network IO is done in…
user826955
  • 3,137
  • 2
  • 30
  • 71
5
votes
1 answer

main: src/unix/core.c:117: uv_close: Assertion `!uv__is_closing(handle)' failed

When I try to use the function uv_close((uv_handle_t*)client,NULL) in libuv library to actively close the TCP connection with the client, the error "main: src/unix/core.c:117: uv_close: Assertion `!uv__is_closing(handle)' failed." was…
Trl
  • 51
  • 1
  • 2
5
votes
1 answer

Event loop handling for sd-bus in libuv

We have an eventloop from libuv to handle unixsockets and TCP sockets. The program now also must handle DBus, and we decided to use sd-bus for that. Lennart wrote on his blog: Note that our APIs, including sd-bus, integrate nicely into…
TheJJ
  • 931
  • 12
  • 21
5
votes
0 answers

Node.js event loop latency testing

I measure nodejs event loop using process.hrtime() also I count percentiles for measuring intervals. Here is my simple benchmark example I have run this test on PC with CPU i7-4770. This is how graph looks like when script runs on Windows 7(same…
5
votes
2 answers

Can libuv(node.js's async lib) run on Apple IOS / Android?

I have done some research to this effect but it is unclear if this is possible to use libuv on IOS/Android? If its not possible what is restricting it? I am looking to write a C++ library that I can use for the same application on IOS, Android,…
Adam
  • 1,059
  • 9
  • 15
5
votes
3 answers

C++ error: reference to non-static member function must be called

I'm trying to create a class to abstract some basic behavior of libuv's networking functions. #define TCP_BACKLOG 256 class _tcp { uv_tcp_t* tcp = NULL; public: ~_tcp() { delete tcp; } void…
Ale Morales
  • 2,728
  • 4
  • 29
  • 42
5
votes
2 answers

Is libuv just a wrapper on libev on POSIX systems?

I am really confused between libev and libuv. Is libuv just a wrapper on libev on POSIX systems? If not where does it differ?
5
votes
0 answers

Using Redis with libuv in Windows

I'm trying to compile the example program that comes with hiredis (C++), using libuv as an event library. The Windows-compatible version of Redis uses a library called Win32_Interop. I've run into two problems: Both libuv and Win32_Interop define…
albizgil
  • 103
  • 6
5
votes
1 answer

How do I store a reference to a function so I can call it back later in a node.js C++ addon module?

Here is a node.js addon module I've written in C++ and built using node-gyp. When StoreFunction I am trying to store a pointer to the function so I can use it later When I try to invoke it later though in InvokeFunction I get a Segmentation fault.…
Darren White
  • 525
  • 5
  • 14
1 2
3
26 27