ipc

Redirecting stdout of one process object to stdin of another

前提是你 提交于 2019-12-18 03:44:45
问题 How can I set up two external executables to run from a c# application where stdout from the first is routed to stdin from the second? I know how to run external programs by using the Process object, but I don't see a way of doing something like "myprogram1 -some -options | myprogram2 -some -options". I'll also need to catch the stdout of the second program (myprogram2 in the example). In PHP I would just do this: $descriptorspec = array( 1 => array("pipe", "w"), // stdout ); $this->command

what are the models to distribute tasks in processes using openMPI?

て烟熏妆下的殇ゞ 提交于 2019-12-17 21:21:56
问题 The thing i want to ask from you is : i have several steps of a big source code (each step has a virtual computation time and virtual communication data,i am taking only virtual as i wants to model the latency and somehow i managed to measure them throughout the source code) . I need to test this by make the code sleep for the computation time and transferring the data equivalent to the communication data . Can you suggest some configuration models to the same ? My aim is to minimizing the

Communicating between NodeJS and C using node-ipc and unix sockets

前提是你 提交于 2019-12-17 18:47:53
问题 I want to communicate between NodeJS and a C program using node-ipc, over a Unix socket, which according to that homepage is the fastest option. (They will be on the same machine). That package claims it could communicate with a C program. (I had to sanity check). The problem is the examples don't give example C code, and I have next to no idea how I'd get them to talk. Can anyone point me to an example of C code to match those client/server examples? For example, how would I adapt this

Best way to accomplish inter-activity communication in an Android TabHost application

浪尽此生 提交于 2019-12-17 18:30:09
问题 Here's the deal: I have an Android application that needs to call a web service every X seconds (currently 60 seconds). This application has multiple tabs and these tabs all need to interact with the data themselves. One is a MapView, one is a ListView and then the third is irrelevant but will need to also get some global data eventually. The issue is that I want my main activity to have a thread that runs in the background, gets the results and then instructs both child activities in the

Sharing memory between processes through the use of mmap()

不羁岁月 提交于 2019-12-17 18:27:09
问题 I'm in Linux 2.6. I have an environment where 2 processes simulate (using shared memory) the exchange of data through a simple implementation of the message passing mode. I have a client process (forked from the parent, which is the server) which writes a struct(message) to a memory mapped region created (after the fork) with: message *m = mmap(NULL, sizeof(message), PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, -1, 0) This pointer is then written to a queue (in form of a linked list) into

Fork parent child communication

℡╲_俬逩灬. 提交于 2019-12-17 17:58:29
问题 I need some way for the parent process to communicate with each child separately. I have some children that need to communicate with the parent separately from the other children. Is there any way for a parent to have a private communication channel with each child? Also can a child for example, send to the parent a struct variable? I'm new to these kind of things so any help is appreciated. Thank you 回答1: (I'll just assume we're talking linux here) As you probably found out, fork() itself

Simple IPC between C++ and Python (cross platform)

纵然是瞬间 提交于 2019-12-17 17:29:16
问题 I have a C++ process running in the background that will be generating 'events' infrequently that a Python process running on the same box will need to pick up. The code on the C side needs to be as lightweight as possible. The Python side is read-only. The implementation must be cross-platform. The data being sent is very simple. What are my options? Thanks 回答1: zeromq -- and nothing else. encode the messages as strings. However, If you want to get serialiazation from a library use protobuf

wait process until all subprocess finish? [duplicate]

心不动则不痛 提交于 2019-12-17 10:25:37
问题 This question already has answers here : Python on Windows - how to wait for multiple child processes? (5 answers) subprocess.wait() not waiting for Popen process to finish (when using threads)? (4 answers) Closed 6 years ago . I have a main process which creates two or more sub processes, I want main process to wait until all sub processes finish their operations and exits? # main_script.py p1 = subprocess.Popen(['python script1.py']) p2 = subprocess.Popen(['python script2.py']) ... #wait

Socketpair() in C/Unix

心已入冬 提交于 2019-12-17 10:17:21
问题 I have 2 applications on the same system that I need to communicate back and forth. From my research I believe this is called Inter Process Communication and the use of socketpair() is the best method for my problem. I am tearing my hair out (literally) trying to get started with creating sockets with socketpair() in C. From what I understand, sockets are a very complex topic and me being a novice C programmer is surely not helping the situation. I googled for the last 48 hours, read

Comparing Unix/Linux IPC

江枫思渺然 提交于 2019-12-17 05:16:12
问题 Lots of IPCs are offered by Unix/Linux: pipes, sockets, shared memory, dbus, message-queues... What are the most suitable applications for each, and how do they perform? 回答1: Unix IPC Here are the big seven: Pipe Useful only among processes related as parent/child. Call pipe(2) and fork(2). Unidirectional. FIFO, or named pipe Two unrelated processes can use FIFO unlike plain pipe. Call mkfifo(3). Unidirectional. Socket and Unix Domain Socket Bidirectional. Meant for network communication, but