ipc

How can I prevent the parent from blocking when writing to a child?

Recently I had a problem using (pipe |-) when I wanted to communicate between two processes. Basically, the child process couldn't process STDIN as fast as it was filled up by parent. This caused parent to wait until STDIN was free and made it run slow. How big can STDIN be and is it possible to modify it. If yes, what is the best prac...

Sleep while holding a boost::interprocess::scoped_lock causes it to be never released

Hi, I'm doing IPC on Linux using boost::interprocess::shared_memory_object as per the reference (anonymous mutex example). There's a server process, which creates the shared_memory_object and writes to it, while holding an interprocess_mutex wrapped in a scoped_lock; and a client process which prints whatever the other one has written ...

Why is IPC::Open2::open2 returning the parent process ID?

I have the following script running in Perl 5.10 in cygwin: use IPC::Open2; use Symbol qw(gensym); my $in = gensym(); my $out = gensym(); my $pid = open2($out, $in, "$exe"); waitpid $pid, 0; The value of $pid is the the PID of the perl process running, not that of the executable pointed to by $exe. Any ideas? ...

How to transfer sensitive data between processes in Windows?

I would like to transfer user name and password information from one process to another process running on the same server in Windows. What is the best approach to achieve this transfer in a secure way? One simple approach is to copy the passwords to a file and then have the other process read from a file and then delete the file once it...

How can I get cross-thread communication in a Perl GTK program?

I have a Perl program that has a GTK2 GUI (via the Gtk2 package). This program also opens a network socket (actually via LWP) in another thread, and continuously makes a request for a certain URL, waiting for an event to happen. If an event occurs, then its data must be processed and interpreted, and an appropriate callback function use...

UNIX Domain Sockets and Cocoa

I want to implement IPC in a Cocoa application using UNIX domain sockets, with which I have no experience. I found Apple's CFLocalServer example project, but it's written in C and looks, well, fairly complicated (and yes, I have read most of it). Are the techniques demonstrated in CFLocalServer still state-of-the-art, or is there a way...

.NET inter-process "events"

I have multiple instances of the same application running. The user ask can click "Quit" on each instance to shut it down. I would like to add the choice to "Quit All Instances", which will raise some kid of "event" that notifies all instances of the application that they should close. I don't need to transport any data along with this ...

Interprocess communication on windows

I have a TCL script running on windows. I need to communicate to a old vc++ 6 app running in a different process. I need to have 2 way communication. In Linux I would use dbus, but what IPC strategy should I use for windows? ...

Interprocess Mutex In Perl

I have a Perl CGI program that executes under mod_perl. Within the program, I would like to prevent a resource from accessing by multiple processes at the same time. # Semaphore Initialization Code # 10023 is unique id, and this id will be same across different apache process. # 1, Only one semaphore being created. # 0722, as all proces...

How can I send a command to a running Java program?

I have a Java program and I want to send a command from my Win32 application. Normally I'd use WM_COPYDATA but what options do I have with Java? ...

Process on linux ignoring resource limits

I had asked some questions about developing an online judge sometime ago on stackoverflow and I found quite a few good answers to that. I've started working on developing one and I seem to have run into a major flaw in my code. The user submitted source will be compiled on the server. This is done by exec()ing gcc in a forked process. N...

How to provide for IPC API backward compatibility

I am designing a (SOAP-like) inter-process communication protocol for making function calls over a network. I want to make sure an older client can talk to a newer server. After thinking over it for a while, it seems like the only thing I can do are: avoiding API changes make it possible to add functions make it possible to add functio...

Seeking open source linux tools for distributed task management.

We have an architecture with a couple hundred of servers with about 200 processes (all developed in-house) spread over them, some controlled by crontab and some that run as daemons. Some servers are in 'groups' where all servers are configured identically, and other servers have custom configurations. I've been tasked with centralizin...

.Net 2.0 Windows Service Process Communication: Database or IPC?

I have a Windows Service running on a .Net 2.0 environment (NOT UPGRADABLE TO 3/3.5). The service uses a System.Timers.Timer on a X second Interval to poll for items on a database table. The Timer.Elapsed event handling code is wrapped around a lock statement to prevent the next Elapsed event of running if the previous processing has no...

Measuring time taken by an exec()-ed process on linux

I'm using the times() function to measure the value but I'm not sure if my approach is correct. Please have a look and advice struct tms tms_start, tms_end; if (!(pid=fork())) { //some necessary operations here times(&tms_start); execl(...); } else if (pid) { //in parent int status; wait(&status); times(&tms_...

semget fails with "Permission denied"

Hi I have 2 processes P1 and P2. P1 is running as root, and is creating a semaphore with the following call: semget (key, 1, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH | IPC_CREAT); and am trying to get the handle to the same semaphore in another process P2, which is running under the normal user's context. In this proce...

Sending data via a socket from Objective-C to Java

I have a Java program (call it Jack) and an Objective-C program (call it Oscar), which I run on the same Mac OS X computer. Oscar sends a string message via a socket to Jack, once per second. For reliability and performance would it be better to maintain an open socket between Jack and Oscar? Or would it be better to repeatedly open a ...

How to emulate shm_open on Windows?

My service needs to store a few bits of information (at minimum, at least 20 bits or so, but I can easily make use of more) such that it persists across service restarts, even if the service crashed or was otherwise terminated abnormally it does not persist across a reboot can be read and updated with very little overhead If I store ...

using unix domain socket and sharing fd's

Hello All, Not been able to figure out why recvmsg() blocks when i try this test app on ubuntu. http://web.mit.edu/kolya/misc/break-chroot.c thanks ...

Python processes stops responding to SIGTERM / SIGINT after being restarted

I'm having a weird problem with some python processes running using a watchdog process. The watchdog process is written in python and is the parent, and has a function called *start_child(name)* which uses subprocess.Popen to open the child process. The Popen object is recorded so that the watchdog can monitor the process using poll() a...