child-process

Are IPython engines independent processes?

北城以北 提交于 2019-12-02 17:07:23
问题 From the IPython Architecture Overview documentation we know that ... The IPython engine is a Python instance that takes Python commands over a network connection. Given that it is a Python instance does that imply that these engines are stand alone processes? I can manually load a set of engines via a command like ipcluster start -n 4 . Doing thus is the creation of engines considered the creation of child processes of some parent process or just a means to kick off a set of independent

SIGCHLD is sent on SIGCONT on Linux but not on macOS

与世无争的帅哥 提交于 2019-12-02 13:35:17
问题 In the main process I listen to SIGCHLD: signal(SIGCHLD, &my_handler); Then I fork() , execv() and let it run in background (/bin/cat for example). When I try from terminal to send SIGSTOP to the child process, my_handler() gets called. But when I try to send SIGCONT to it, the the handler isn't called on macOS but it's executed on my Ubuntu. Man: SIGCHLD: child status has changed. Am I missing something? Is it an expected behaviour? I wrote my app on Ubuntu and expected it to work on mac as

SIGCHLD is sent on SIGCONT on Linux but not on macOS

六月ゝ 毕业季﹏ 提交于 2019-12-02 04:04:07
In the main process I listen to SIGCHLD: signal(SIGCHLD, &my_handler); Then I fork() , execv() and let it run in background (/bin/cat for example). When I try from terminal to send SIGSTOP to the child process, my_handler() gets called. But when I try to send SIGCONT to it, the the handler isn't called on macOS but it's executed on my Ubuntu. Man: SIGCHLD: child status has changed. Am I missing something? Is it an expected behaviour? I wrote my app on Ubuntu and expected it to work on mac as well. I tried with sigaction() as well, but with the same results. Here's a sample code to demonstrate:

Can we launch a node command on a mac without node installed when using electron-packager?

拟墨画扇 提交于 2019-12-02 04:04:06
When I package an electron app using electron-packager. The app spawns a child process which uses a 'node' command. Now if I try to launch my app in a system with no node installed on it, does the app work? I have been trying to achieve this and facing various issues, the electron community suggested me to use fork method, spawn method with 'Process.execPath' as command and also setting the ELECTRON_RUN_AS_NODE variable but nothing seems to work on my end. Now after doing all this I question myself, do I definitely need node installed on my system to run the app? or is there really a way that

Nodejs always cann't capture child process's stdout data completely, unless child process fllush(stdout)

流过昼夜 提交于 2019-12-02 00:30:21
I use nodejs to captured its child process's stdout data, but always captured the former part of child process's stdout data. When I add fllush(stdout) ,It works OK. But I don't know why, and don't want to add flush(stdout). Here is my code: var tail_child = spawn(exefile, [arg1, arg2, arg3]); tail_child.stdin.write('msg\n'); tail_child.stdout.on('data', function(data) { console.log(data); }); child_process.c printf("data\n"); Need your help! Thank you very much! By default, stdout in general is buffered until a newline is written. However, if stdout is not a tty (which is the case here with

java Process' inputStream stuck

空扰寡人 提交于 2019-12-01 23:05:30
Here's my scenario: process A spawns child process B and spins threads to drain B's outputs. process B spawns daemon process C and drains its outputs, too. process B finishes, daemon process still lives. process A finds out that process B exited via process.waitFor(). However, it's stuck on reading the input streams of process B. It's because B has started a daemon. The input stream receives EOF only when the process C exits. This only happens on Windows. I'm using the ProcessBuilder. Here're the solutions I came up with and I'd like to hear your feedback as none of the solutions I really like

java Process' inputStream stuck

耗尽温柔 提交于 2019-12-01 22:08:46
问题 Here's my scenario: process A spawns child process B and spins threads to drain B's outputs. process B spawns daemon process C and drains its outputs, too. process B finishes, daemon process still lives. process A finds out that process B exited via process.waitFor(). However, it's stuck on reading the input streams of process B. It's because B has started a daemon. The input stream receives EOF only when the process C exits. This only happens on Windows. I'm using the ProcessBuilder. Here're

bash restart sub-process using trap SIGCHLD?

旧城冷巷雨未停 提交于 2019-12-01 17:01:00
问题 I've seen monitoring programs either in scripts that check process status using 'ps' or 'service status(on Linux)' periodically, or in C/C++ that forks and wait on the process... I wonder if it is possible to use bash with trap and restart the sub-process when SIGCLD received? I have tested a basic suite on RedHat Linux with following idea (and certainly it didn't work...) #!/bin/bash set -o monitor # can someone explain this? discussion on Internet say this is needed trap startProcess

Command line application: How to attach a child process to xcode debugger?

社会主义新天地 提交于 2019-12-01 13:01:09
I'm currently making a command line app in C in which many child process is created. So I need to debug this children code. I have created a child process on Xcode as follow. (see the break point and running cursor.) After executing some statements, I get xcode to attach GBN(885) to the xcode debugger as shown in below figure. It doesn't work. How can I attach the child process to xcode debugger? Thank you in advance. inherithandle Google and Apple developer page are really silent on this issue and finally I've found a good workaround. This error message appears when we get Xcode debugger to

How to wait for child process to set variable in parent process?

此生再无相见时 提交于 2019-12-01 05:29:41
问题 use Parallel::ForkManager; my $number_running = 0; my $pm = new Parallel::ForkManager(30); $pm->run_on_start( sub { ++$number_running; } ); $pm->run_on_finish( sub { --$number_running; } ); for (my $i=0; $i<=100; $i++) { if ($number_running == 5) { while ($number_running > 0) {} } # waits forever $pm->start and next; print $i; $pm->finish; } The above code uses Parallel::ForkManager to execute code in a for loop using parallel processes. It is counting how many child processes are running and