spawn

C# Detecting Spawned Processes

半腔热情 提交于 2019-12-10 13:06:38
问题 I'm writing a piece of c# code that launches an installer and waits for it to return before continuing with other stuff. I'm having trouble with certain installers that spawn other processes with the original process returning before the install has actual finished. Is there some way that I can wait until all the processes have finished? To clarify here's the scenario I'm having trouble with: Launch Installer1 Installer1 spawns/launches another installer (Installer2) Installer 1 returns

Spawn multiple telnet with tcl and log the output separately

萝らか妹 提交于 2019-12-10 12:14:03
问题 I'm trying to telnet to multiple servers with spawn & i want to log the output of each in a separate files. If i use the spawn with 'logfile' then, it is logging into a same file. But i want to have it in different files. How to do this? 回答1: Expect's logging support (i.e., what the log_file command controls) doesn't let you set different logging destinations for different spawn IDs. This means that the simplest mechanism for doing what you want is to run each of the expect sessions in a

Erlang spawn problems

岁酱吖の 提交于 2019-12-10 10:46:28
问题 I am having problem with 'spawn' in erlang, it seems processes just die after awhile. Here's the simple code: -module(simple). -export([server/1, client/1, owner/1, spawn_n/2, start/1, main/1]). server(State) -> receive {request,Return_PID} -> io:format("SERVER ~w: Client request recieved from ~w~n", [self(),Return_PID]), NewState = State + 1, Return_PID ! {hit_count,NewState}, server(NewState); {server_owner,Owner_PID} -> io:format("SERVER ~w: Owner request recieved from ~w~n", [self(),

mpi4py: close MPI Spawn?

社会主义新天地 提交于 2019-12-10 10:15:47
问题 I have some python code in which I very often Spawn multiple processes. I get an error: ORTE_ERROR_LOG: The system limit on number of pipes a process can open was reached in file odls_default_module.c at line 809 My code roughly looks like this import mpi4py comm = MPI.COMM_WORLD ... icomm = MPI.COMM_SELF.Spawn(sys.executable,args=["front_process.py",str(rank)],maxprocs=no_fronts) ... message = icomm.recv(source=MPI.ANY_SOURCE,tag=21) ... icomm.Free() The Spawn command is called very often

Spawning process with arguments in node.js

五迷三道 提交于 2019-12-08 14:46:18
问题 I need to spawn a child process from node.js , whilst using ulimit to keep it from using to much memory. Following the docs, it wasn't hard to get the basic spawn working: child = spawn("coffee", ["app.coffee"]) . However, doing what I do below just makes the spawn die silently. child = spawn("ulimit", ["-m 65536;", "coffee app.coffee"]) If I would run ulimit -m 65536; coffee app.coffee - it works as intented. What am I doing wrong here? 回答1: Those are two different commands. Don't club them

Spawn an independent child

怎甘沉沦 提交于 2019-12-08 00:57:37
问题 How can you use C to spawn an independent child process that goes about its business without thinking about the father? I want to spawn several processes and shortly after they have been created they go to sleep for about 2 minutes before they do their job. However, I don't want the father to wait until the child is finished because in the meantime I want to spawn off more processes. I'm on Linux. 回答1: Use fork(). The fork() System Call pid_t pid = fork (); if (pid < 0) // Error else if (pid

Using two commands (using pipe |) with spawn

余生长醉 提交于 2019-12-07 13:05:06
问题 I'm converting a doc to a pdf (unoconv) in memory and printing (pdftotext) in the terminal with: unoconv -f pdf --stdout sample.doc | pdftotext -layout -enc UTF-8 - out.txt Is working. Now i want use this command with child_process.spawn : let filePath = "...", process = child_process.spawn("unoconv", [ "-f", "pdf", "--stdout", filePath, "|", "pdftotext", "-layout", "-enc", "UTF-8", "-", "-" ]); In this case, only the first command (before the |) is working. Is i possible to do what i'm

How to switch terminal to new child process of process launched with NSTask?

别来无恙 提交于 2019-12-07 09:53:55
I made a pseudo terminal with method described here: http://lists.apple.com/archives/student-dev/2005/Mar/msg00019.html The terminal itself worked well. Anyway the problem is terminal cannot being switched to child process. For an example, I launched bash with NSTask , and if I execute ftp within the bash , it stops automatically. ftp ftp ftp> [1]+ Stopped ftp bash-3.2$ And if I try to continue the ftp with fg , it terminates quietly. (I checked this with Activity Monitor ) fg fg ftp bash-3.2$ fg fg bash: fg: current: no such job bash-3.2$ I think it needs some more infrastructure (which

Execute shell script in gruntfile and assign result to variable

纵然是瞬间 提交于 2019-12-07 01:00:46
问题 I am using grunt to manage a suite of mocha-run tests. One of the things required in the mocha test suite is that certain environment variables be set so that the tests are executed properly based on the environment of the developer running the tests. One of these environment variables will have a different value on every developer's machine, so we execute a bash script to return that value for the environment variable we are setting. I am using grunt.util.spawn to run the script and assign

Errno::ENOMEM: Cannot allocate memory - cat

我与影子孤独终老i 提交于 2019-12-06 19:37:30
问题 I have a job running on production which process xml files. xml files counts around 4k and of size 8 to 9 GB all together. After processing we get CSV files as output. I've a cat command which will merge all CSV files to a single file I'm getting: Errno::ENOMEM: Cannot allocate memory on cat (Backtick) command. Below are few details: System Memory - 4 GB Swap - 2 GB Ruby : 1.9.3p286 Files are processed using nokogiri and saxbuilder-0.0.8 . Here, there is a block of code which will process 4