down votefavorite 
<http://stackoverflow.com/questions/42929679/spawned-node-child-process-performance-issues#>

I'm new to node. I started building a simple web interface to control my 
simulation program written in C++. With the node program I'm creating 
config files and then start and stop the simulation. I want to use the 
child_process module to start my C++ simulation program. It's an real time 
simulation wich is clocked by an external signal from an IO. So it's time 
critical. Node and the simulation are running on a Raspberry Pi 3. The 
simulation results from the C++ program are being sent to a microcontroller 
over SPI. The microcontroller is doing some stuff and then puts out the 
simulation result in parallel to a power electronic and a 
digital-analog-converter for control purposes. I'm looking at the analog 
output with an oscilloscope.

If I'm running my C++ simulation program standalone all is fine and the 
analog signal is as expected.

If I'm running my simulation using node with child_process and the execFile 
method all is fine and the analog signal is as expected.

If I'm running my simulation using node with child_process and the spawn 
method the simulation will output with some delays in between.

I read that child.stdin.end() solves the problem, but thats not the case.

So why is it that with spawn my child process is running slower?

My second problem is that I want to do something with the spawned process. 
For that I need the PID of the process. But child.pid returns the wrong 
PID. In both cases with spawn and execFile.

Best regards Dennis.

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/7cd1dd5b-bac3-48d0-bda3-596b30307738%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to