ipc

Process communication of Python's Multiprocessing

半世苍凉 提交于 2019-12-20 22:00:08
问题 I've learned about Python multiprocess's Pipes/Queues/Shared ctypes Objects/Managers, and I want to compare them with Linux's anonymous pipes, named pipes, shared memory, socket, and so on. I now have the following questions The pipes and queue modules of Python's multiprocessing are based on anonymous pipes. Does it provide named pipes? Does Python multiprocessing.sharedctypes support independent process communication? I think it only supports father and child process or brotherly process

How to send integer with pipe between two processes!

戏子无情 提交于 2019-12-20 11:56:11
问题 I am trying to send an integer with pipe in a POSIX system but write() function is working for sending string or character data. Is there any way to send integer with a pipe? Regards 回答1: The safe way is to use snprintf and strtol . But if you know both processes were created using the same version of compiler (for example, they're the same executable which fork ed), you can take advantage of the fact that anything in C can be read or written as an array of char : int n = something(); write

IPC between .NET and Java client applications

三世轮回 提交于 2019-12-20 10:10:41
问题 I must get two different client application talk without any kind of broker or server. What is the best method for IPC beween two process, Java and .NET? It must able to be work in multi-user termainl server, so no socket please. I wish that it is lightweight and simple, something plug and run, so no RMI/WS please. I'm now thinking about JNI to access Mutex and Named pipes, am I going to a right direction? Any ideas welcome! Thanks Dennis 回答1: You can access WinAPI through JNI(Java) and

can a python script know that another instance of the same script is running… and then talk to it?

≡放荡痞女 提交于 2019-12-20 09:40:00
问题 I'd like to prevent multiple instances of the same long-running python command-line script from running at the same time, and I'd like the new instance to be able to send data to the original instance before the new instance commits suicide. How can I do this in a cross-platform way? Specifically, I'd like to enable the following behavior: " foo.py " is launched from the command line, and it will stay running for a long time-- days or weeks until the machine is rebooted or the parent process

Low-latency IPC between C++ and Java

谁说我不能喝 提交于 2019-12-20 09:19:35
问题 What is the best way to implement C++/Java IPC for the following situation? (Someone recently asked a similar question, but my requirements are more specific) I have two programs -- one written in C++, the other in Java -- that need to communicate with each other. Both are running on the same machine. The programs send messages to each other. Messages are typically short (less than a few hundred bytes), but could potentially be 100KB or more in size. Messages do not need to be acknowledged (i

How to transfer files between Android applications running on the same device?

ぐ巨炮叔叔 提交于 2019-12-20 08:58:03
问题 I am writing an Android application that interfaces with a RESTful service. This web service essentially fronts a file system, and provides metadata as well CRUD access to the files. My application retrieves the metadata, and exposes it to 3rd party apps through a ContentProvider . I need to add the ability for 3rd party applications, running on the same device as my app, to CRUD the actual files by making requests to/from my app (not directly with the server). This means they need to either

Interprocess communication using pipe in Linux

一笑奈何 提交于 2019-12-20 07:58:29
问题 I have written my code for writing a number to pipe in linux. it is as under,but it is showing errors,can anyone help me on this. Basically the problem statement for the program is as below:- One program will open a pipe, write a number to pipe. - Other program will open the same pipe, will read the number and print them. - Close both the pipes int main() { int number; FILE *fout; fout = popen(" ","w"); pclose(fout); return 0; } Now my question is what command should i give in the popen

Does non-blocking read from std::cin work with std::this_thread::sleep_for() or std::this_thread::yield() (IPC)

蹲街弑〆低调 提交于 2019-12-20 04:50:05
问题 I've encountered a specific problem with my implementation and can't find a solution for it. I have a two-part application. One part is a Java swing GUI. The second part is a C++ application that does all the (time consuming) calculation logic. The two processes communicate (in both directions) with their output and input streams. My problem now is that in one part of the C++ program I have to wait for user input coming from the Java program. However, waiting seems to block. What works

using shared memory with php and c?

时光总嘲笑我的痴心妄想 提交于 2019-12-20 02:48:08
问题 Can you use shared memory to communicate between php scripts and c program in windows? The c program runs all the time and uses memory mapped files ie: handle1 = CreateFileMapping( (HANDLE)0xFFFFFFFF, NULL, PAGE_READWRITE, 0, sizeof(byte)*BUFFER_SIZE, "my_foo" ); hView = (LPINT) MapViewOfFile(handle1, FILE_MAP_ALL_ACCESS, 0, 0, 0); For the PHP scripts can I just use the below code to open the memory mapped file created by the c program? $shmkey = @shmop_open(ftok("my_foo", 'R'), "a", 0644,

What is the best method of inter-process communication between Java and .NET 3.5?

£可爱£侵袭症+ 提交于 2019-12-20 01:52:06
问题 A third-party application reads some Java code from an XML file, and runs it when a certain event happens. In Java, I want to tell a .NET 3.5 application, running on the same machine, that this event occurred. The total data transferred each time is probably a few characters. What is the best way of using Java to tell the .NET process that something happened? Java doesn't seem to support Named Pipes on Windows, .NET doesn't natively support memory-mapping, and any solution involving web