process

Reading child process' output as soon as some is available?

I've been trying various methods (popen, pipes + fork/exec, ...) to read a child process' output, all of which are working, but exhibit the same behavior: whenever I try to read the output using read/fread, it only returns when the buffer is completely full, or when the child exits. I'm looking for a behavior that's more like that of soc...

How can I determine if my process is being run interactively?

Is there a standard(ish) POSIX way of determining if my process (I’m writing this as a Ruby script right now; but I’m curious for multiple environments, including Node.js and ISO C command-line applications) is being run in an interactive terminal, as opposed to, say, cron, or execution from another tool, or… so on and so forth. Specifi...

How to avoid XmlSerializer failure if process environment is too large?

Hi, I ran into a strange problem last week. A call to new XMLSerializer(typeof(MyType)) crashed with an ExternalException, telling me that csc.exe could not be executed. After some investigation I found that this exception only occurs if the process environment size reaches a "critical" limit. I created a little sample application to ve...

looking out for a web based process or workflow designer software

can any one suggest a tool or component to integrate with web based application with a workflow or business process designer ... ...

Assigning Process to Cores using Perl

Hi Folks, How can I assign processes to specific cores ?. I have a 16 core machine and need to assign processes to multiple cores rather then all/few of them running on same cores. Can Parallel::ForkManager do this ?. or How do you do it with using standard perl distribution ? Any pointers are appreciated. Thanks ...

Linux: Processes and Threads in a Multi-core CPU

Is it true that threads, compared to processes, are less likely to benefit from a multi-core processor? In other words, would the kernel make the decision of executing threads on a single core rather than on multiple cores? I'm talking about threads belonging to the same process. ...

making a PHPUnit assertion only after a system process has finished running

I'm trying to test the result of a background shell process (ran with exec()). For this, I need the PHPUnit assertion to wait until the process ends. I was wondering what is the best way to do this? Should I place the check for the running process in a loop, and use sleep() with a very small parameter to wait until it's finished? ...

How to find a solaris process with ___ status

I made the following script which searches for certain processes, displays uses pflags for each one, and stops when it finds one with the word "pause": !cat find_pause #!/usr/bin/perl -W use warnings; use strict; if (open(WCF, "ps -ef | grep '/transfile' | cut -c10-15 | xargs -n1 pflags 2>&1 |" )) { while (<WCF>) { ...

Problem Starting Selenium Process from a Console Application

Let me be clear: - I have Java.exe in my path environment variable - So if I want to run a "selenium-server" I will do : 1. Start cmd.exe Microsoft Windows [Version 5.2.3790] (C) Copyright 1985-2003 Microsoft Corp. C:\Documents and Settings\cnguyen> 2. Then: C:\Documents and Settings\cnguyen>cd C:\Selenium RC 0.9.2\selenium-server-0.9.2...

Access denied while getting process path

Hello, I am trying to get process path by pid but I'm getting Win32Exception (access id denied). The code looks like this: string path = Process.GetProcessById(pid).MainModule.FileName I have tried using OpenProcess with GetModuleFileNameEx but OpenProcess is returning 0. I even tried enabling SeDebugPrivilege according to C# – How ...

python multiprocessing does not work

I don't understand why this simple code # file: mp.py from multiprocessing import Process import sys def func(x): print 'works ', x + 2 sys.stdout.flush() p = Process(target= func, args= (2, )) p.start() p.join() p.terminate() print 'done' sys.stdout.flush() creates "pythonw.exe" processes continuously and it doesn't print a...

Start a process in the background in Linux with C

I am trying to do something a little weird here. I need to start a process, logcat, from a deamon that will run in the background and print to the terminal without taking control of stdin. It is for logging so ideally logcat will print log messages while still allowing the user to input standard commands and initialize programs from th...

How can I start and stop a jar file using another jar file?

Hello friends, I want to start and stop a jar file using another jar file or java class. I am able to start the jar file using this command: Runtime run=Runtime.getRuntime(); Process process=run.exec("java -jar setvalue.jar"); The process is started and working fine. But I am not getting how I can close that process from other java c...

"Gracefully" killing a process

Right now I am using Process.Kill() to kill a process. Is there a way though, instead of just killing it immediately, that I can like send a message to the process instructing it to close so that it can gracefully clean up and shut down. Basically, I'm looking for the equivlent to just clicking the red X in the upper right hand corner, w...

What was your most efficient technique to improve productivity and quality?

I am aware that this could be seen as subjective but this is definitely not my intention. I am always on the hunt for techniques that I may have never heard of that help improve both productivity and quality of software engineers. In particular I am looking for tools, techniques, approaches, tips and tricks, best practices, etc. that he...

Problem in process hooking

I have a process (say, for example, MyProcessA), hooked an exe and injected my dll (MyDll.dll) into the process space of MyProcessA, so even if it's gonna create n number of child processes it will be process hooked as well. I have no problem in hooking and injecting the dll into the process. I have hooked all file and process dependant ...

Crash-proofing Mac Cocoa application

In my Cocoa application I need to run a task that uses unstable unfixable code. It takes little input, works independently from the rest of the app, and generates thousands of ObjC objects as a result. How can I run the unstable part and let it crash without taking down whole application? Is it possible to fork() Cocoa application? How...

VB.NET - Set external process priority to Low / Pause external process (while running)

Developing a UI for an image compactor, and I have built a Pause/Resume button. I need it to pause/set priority to low while it is running. Now I know that it is dangerous to Pause a process and has to do with threading, but if someone knows how to do this, please help! Also, if the above cannot be done efficiently enough, I would ra...

File.Delete error "The process cannot access the file because it is being used by another process"

I have written a DotUnit test suite for testing some data import functionality in my application. It works by making a backup of some local Microsoft Access Database, let's call it 'Test.mdb', to 'Test.mdb.bak', performing some data import (and subsequent Assert checks) and then restoring the original from the backup. The SetUp() functi...

How can I capture the stdout from a process that is ALREADY running

I have a running cron job that will be going for a while and I'd like to view its stdout. I don't know how important the fact that the process was started by cron is, but I figure I'd mention it. This is on OSX so, I don't have access to things like... /proc/[pid]/..., or truss, or strace. Suggestions of executing with IO redirection ...