Skip to content
Advertisement

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 process it is non-zero. So from

Is there a way to assign different jobs (processes) to specific core in linux using python?

I have python functions that should run parallelly in a linux environment utilizing multi cores. Is there a way to specify which core should be used for each process explicitly? Currently, I am using python multiprocessing module to run these python functions as parallel processes in 4 cores. Answer Possibly with the combination of os.sched_setaffinity and os.sched_getaffinity. The docstring says:

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

Advertisement