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
274
votes
4 answers

How does libuv compare to Boost/ASIO?

I'd be interested in aspects like: scope/features performance maturity
oberstet
  • 21,353
  • 10
  • 64
  • 97
36
votes
6 answers

What does the "EXDEV: cross-device link not permitted" error mean?

What does this error actually mean? What is a "cross-device link"? It is mentioned on this libuv page but it doesn't give any details beyond "cross-device link not permitted".
callum
  • 34,206
  • 35
  • 106
  • 163
34
votes
1 answer

How is asynchronous javascript interpreted and executed in Node.js?

I've been doing a lot of research into the core of Node.js lately, and I have some questions about the inner workings of the Node platform. As I understand it, Node.js works like this: Node has an API, written in Javascript, that allows the…
Chandler Freeman
  • 899
  • 1
  • 10
  • 25
29
votes
1 answer

How many threads does Node actually create?

After reading this great answer about Node's thread nature, I started to play with UV_THREADPOOL_SIZE system variable to change the size of thread pool, and I found something interesting: When I set process.env.UV_THREADPOOL_SIZE = 10; I get 15…
Oleg
  • 22,300
  • 9
  • 68
  • 84
28
votes
4 answers

Relationship between event loop,libuv and v8 engine

I am learning through the architecture of Node.js. I have following questions. Is event loop a part of libuv or v8? Is event queue a part of event loop? are event queue generated by libuv or v8 engine or event loop itself? What is the connection…
Prem
  • 5,685
  • 15
  • 52
  • 95
25
votes
3 answers

Why is LIBUV needed in Node JS?

So, maybe this question is too noob and novice to be asked but I still have no clue why LIBUV got a place in Node JS Architecture? So here is my understanding of NodeJs architecture. Node Js is built over V8 V8 is capable of running code written…
Ankur Verma
  • 5,793
  • 12
  • 57
  • 93
25
votes
3 answers

What are node.js bindings?

I am very new to node.js and I can not seem to find a definition anywhere as to what node.js bindings are. I have seen this term used in slides and nodejs talks but it was never clearly explained. Can anyone help clarify this concept for me? I have…
n3wb
  • 1,037
  • 5
  • 12
  • 20
25
votes
2 answers

Confusion about node.js internal asynchronous I/O mechanism

I have learned that node.js use libeio internally to perform async file I/O, with thread pool, on *nix platform, am I right? What about async network I/O? Is it done by libev? Is there also a thread pool? If there is thread pool inside, how…
Aaron Wang
  • 1,091
  • 1
  • 11
  • 17
16
votes
1 answer

Is libuv thread safe?

I have created a new thread dedicated to a libuv run loop. The thread function looks something like this: void thread_function() { uv_loop_t *loop = uv_loop_new(); uv_ref( loop ); uv_run( loop ); } The ref counter increment keeps the thread…
user1157123
15
votes
2 answers

C optimization: conditional store to avoid dirtying a cache line

In the libuv source, I found this code: /* The if statement lets the compiler compile it to a conditional store. * Avoids dirtying a cache line. */ if (loop->stop_flag != 0) loop->stop_flag = 0; Can someone explain this a bit? What…
Albert
  • 65,406
  • 61
  • 242
  • 386
14
votes
3 answers

Why is stdout buffering?

I am trying to learn the libuv api and wrote the following test: #include #include #include void timer_cb(uv_timer_t* timer) { int* i = timer->data; --*i; if(*i == 0) { uv_timer_stop(timer); } …
Baruch
  • 20,590
  • 28
  • 126
  • 201
13
votes
3 answers

Calling Javascript function from a C++ callback in V8

I'm trying to call a registered JS function when a c++ callback is called, but I'm getting a segfault for what I assume is a scoping issue. Handle addEventListener( const Arguments& args ) { HandleScope scope; if…
marchaos
  • 3,316
  • 4
  • 26
  • 35
12
votes
3 answers

process.env.UV_THREADPOOL_SIZE not working?

I am trying to understand the threadpool in nodeJS. on running the code with creating process.env.UV_THREADPOOL_SIZE = 5; process.env.UV_THREADPOOL_SIZE = 5; const https = require('https'); const crypto = require('crypto'); const fs =…
cptiwari20
  • 442
  • 1
  • 7
  • 18
11
votes
3 answers

How do I pump window messages in a nodejs addon?

In a Windows nodejs addon, I've created a window for the purpose of receiving messages. Handle MakeMessageWindow(const Arguments &args) { // exposed to JS ... CreateWindow(L"ClassName", NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, 0, 0); …
josh3736
  • 139,160
  • 33
  • 216
  • 263
11
votes
2 answers

Capture a child process's stdout with libuv

I'm using libuv. I've read http://nikhilm.github.com/uvbook/processes.html and still cannot work out how to capture the stdout of a child process so that it is available in the parent (but not in place of the parent's stdin). My code is…
fadedbee
  • 42,671
  • 44
  • 178
  • 308
1
2 3
26 27