Skip to content

Tag: multiprocessing

libuv: difference between fork and uv_spawn?

Recently I have been playing around with Libuv. I don’t get the programming model as far as child processes are concerned. For example look at the following code: Here the output printed on console is: In my understanding uv_spawn acts like fork(). In child process the value of r is 0 and in parent proc…

C fork and pipe multiple process

I’m trying to implement this command cat /etc/passwd | grep 1000 | cut -d: -f1 in C using system calls fork and pipe. When I use only two commands cmd1 | cmd2 so 1 fork it works fine but when I’m using more than 2 process the problem occurs Here is my code, I think the problem is in the