processes

JUnit Test a Database Failure?

I'm trying to create a test that simulates a system failure to ensure the integrity of a Oracle Berkeley DB XML database. Data loss is currently being experienced during an insert operation so I'd like to setup a test that starts inserting an arbitrary number of documents and sack the process along the way (akin to someone yanking the po...

Outliers during Performance Evaluation

Hello all, I am trying to do some performance measurements using Intels RDTSC, and it is quite odd the variations I get during different testruns. In most cases my benchmark in C needs 3000000 Mio cycles, however, exactly the same execution can in some cases take 5000000, almost double as much. I tried to have no intense workloads runni...

how to change process name of python script running on windows machine

Windows Task Manager (Processes Tab) lists all the running processes. the image name for python scripts is always python.exe (or pythonw.exe or the name of the python interpreter). it there a nice way to change the image name corresponding to a python script? (I mean other than changing the name of the python interpreter) ...

C fork dealing with global variable!

Im not understanding the output of this program: #include <pthread.h> #include <stdio.h> #include <unistd.h> int i = 0; int main() { while(i<3) { fork(); printf("%d\n",i); ++i; } } The output is: 0 1 2 2 1 2 0 1 2 2 2 1 2 2 Can please someone tell me how i should tackle this issue in order to fu...

Viewing full output of PS command

Hi, when I run ps -aux command on my linux server, to which I connected using putty, few processes are too long to fit in my current window width. Is there an alternative? Thank you -- Update -- I am sorry for downgrading,I thought others won't find the answer useful too, so I downgraded. Here is the info you asked for. hadoop-use...

Tracking Chrome and its many processes

I'm trying to keep an eye on how long an application runs. To do this, I capture every process's ID as it starts, and when that process is shut down, I log the time. However, Google's Chrome starts and stops like 6 processes when you start it up and shut it down, meaning each execution of Chrome gets logged multiple times. Is there a be...

Check if process is running

Hello, I am trying to check if a process is running. If it is running I want a return value of 'OK' and if not a return value of 'Not OK'. I can only use 'ps' without any other arguments attached (eg. ps -ef) if thats the correct term. The code I have is: if ps | grep file; then echo 'OK'; else echo 'NO'; fi The problem with this i...

How do I wait on three child processes?

I'm trying to fork 3 different child processes from a parent (and running this on a UNIX box), and I want to have this requirement : The parent must wait till all the 3 children processes have finished executing. I'm using wait for the same .. Here's the code snippet : #include <unistd.h> #include <sys/signal.h> #include <sys/types.h>...

PHP forking and multiple child signals

I'm trying to write a script which creates a number of forked child processes using the pcntl_* functions. Basically, there is a single script which runs in a loop for about a minute, periodically polling a database to see if there is a task to be run. If there is one, it should fork and run the task in a separate process so that the pa...

Stopping an application based on its executable

I'd like to rig a service to run that detects when an application is trying to start, and based on its executable (I'll probably just hash the file and keep a list of blocked app hashes to keep it simple), stop it from executing all together. Ideally I'd like to accomplish this using C#, but I'd be open to using other platforms if it mak...

System.Diaganostics.Process.Id Isn't the Same Process Id Shown in Task Manger. Why?

I'm using c#'s System.Diagnostic.Process object. One of its properties is Id. The Id this produces is not the same as the PID, shown in Windows Task Manager. Why is this? You see, once this process is started. It launches two other unmanaged processes, for which I can't explicitly get IDs for by object property references. I have to sea...

AIR apps and processes

AIR apps are generally very little in size (a few Mb). Why, when you launch them, the task manager shows n processes for n apps launched? And why the memory used is more than 30 Mb (for single process)? I imagine it is the runtime: but why the runtime doesn't load only once (and then is used to load n apps)? I noticed Chrome does quite t...

Can you limit the processing resources that an application can use in .NET

I would like to write a .NET application that runs in the background (stays down in the taskbar) and does a long operation like copying folders of files from one location to another. I want to write it in such a way that other applications that are running don't slow down much. I don't care how long the background app takes. Is there a w...

Killing processes from list of executable names in PowerShell

I've got a PowerShell function that's returning a list of executable names (with the file extension), and I'm trying to kill any of these if they are running, but not having much success. Here's the command I'm using: Get-Executable-Names ` | where { $_ -match ".exe" } ` | foreach { $_ -replace ".exe" } ` | foreach { ps $_ } ` | kill ...

Static / global variables in shared library in C language

Possible Duplicate: Is global variable in a shared library / dll, shared across process Hi stackoverflow, I have just a little question about using .so in C programming. I want to use static and global variables in a shared library. If this library is loaded and used by several processes, will these processes share the global ...

How can I find out what these files or processes do (linux)

When I go onto a *nix system and look as ps -A or -e or top I get a large number of processes that are running. For example. init migration/0 ksoftirqd/0 events/0 khelper kacpid kblockd/0 khubd pdflush pdflush kswapd0 aio/0 kseriod scsi_eh_0 kjournald udevd kauditd kjournald kjournald kjournald kjournald kjournald klogd portmap rpc.idm...

How can I write simulations in Erlang?

Hi guys, I want to do some numerical stuff in Erlang like this: You've got an array with the following values: [2,3,4] In each iteration, you calculate 0.1 * [n-1] + 0.7 *[n] + 0.2 * [n+1] This becomes the new [n]. If n == 0 then [n-1] = 0. If [n] == length of array then [n] = 0. So I try an example: [2,3,4] calculations:...

Why does RunDLL32 process exit early on Windows 7?

On Windows XP and Vista, I can run this code: STARTUPINFO si; PROCESS_INFORMATION pi; BOOL bResult = FALSE; ZeroMemory(&pi, sizeof(pi)); ZeroMemory(&si, sizeof(si)); si.cb = sizeof(STARTUPINFO); si.dwFlags = STARTF_USESHOWWINDOW; si.wShowWindow = SW_SHOW; bResult = CreateProcess(NULL, "rundll32.exe shell32.d...

Source core repositories and sticky notes

An interesting problem occured recently, and I've been thinking of the "best" way (for a given value of "best") to implement this. In essence, it's one of tracking notes against source code. The example that flagged this was getting a problem fixed in live within SLAs, and how to best achieve this. Without going into all the details, it...

Zombie Processes Appearing When I Spawn Processes

I have a pieces of code where i spawn off children processes to make it more efficient. However, they appear to create all sorts of zombie processes which block sockets and bring down the site. spawn(:method => :thread) do if @login_user.suggested_group_info.new_record? xxx end end 1) Why is this creating zombie processe...