ipc

Usage of Different IPC mechanism

荒凉一梦 提交于 2019-12-06 01:57:31
问题 I am a c++ programmer. I wanted to know a real time scenario where we can use different IPC mechanisms like PIPE/Named, Shared Memory. I roughly know where I can use socket and message queue. But for PIPE/Named PIPE and shared memory I am not getting any idea. This is just for understanding about different IPC mechanisms and their usage. Thanks, 回答1: I needed to use Named pipe for communicating with my Erlang Vitual Machine which was running as a daemon. I believe they are being slowly

序列化接口:Serializable 、Parcelable

眉间皱痕 提交于 2019-12-06 01:41:44
一、Serializable 1. 序列化类User public class User implements Serializable{ private static final long serialVersionUID = 212321837362716712L; public int userId; public String userName; public boolean isMale; /** * Ignore getter and setter */ ..... } 2. 序列化过程 User user = new User(0,"jake",true); ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream("cache.txt")); out.writeObject(user); out.close(); 3. 反序列化过程 ObjectInputStream in = new ObjectInputStream(new FileInputStream("cache.txt")); User newUser = (User)in.readObject(); in.close(); 由上述代码可以看到, 1、序列化就是将可序列化类写入到cache.txt文件; 2

How to communicate between Windows Services

安稳与你 提交于 2019-12-06 00:18:33
问题 I have 2 windows services that I created using C#. I would like one of the services to call a function in the second windows service. How should I do it? EDIT: The issue is That I have to application that running ( I don't need them to be Rather service Process is good too) but I need this 2 application to communicate, this 2 application are on the same server, 回答1: Sure. There are a bunch of IPC mechanisms you could use. Remoting, TCP/HTTP Listeners, etc. Does either service provide

message queue in C: implementing 2 way comm

ε祈祈猫儿з 提交于 2019-12-05 23:04:23
I am a student and a begineer in C. I want to implement 2 way communication using message queue in C linux. Do I need two queues or only one to get this done? Also I would like to know can I send data(shown in code) to another process or i need to declare it as a character array. typedef struct msg1 { int mlen; char *data; }M1; typedef struct msgbuf { long mtype; M1 *m; } message_buf; Thanks in advance :) Also I would like to know can I send data(shown in code) to another process or i need to declare it as a character array yes you can send data to another process like #include <sys/types.h>

Is there an IPC transport implementation for Thrift ? or low latency SOA solutions

自古美人都是妖i 提交于 2019-12-05 20:58:21
问题 I want to introduce SOA to a low latency system without the overhead of TCP communication(even on the same machine). Thirft seems like a great fit as I have both Java and php processes. Is there an IPC transport implementation for thrift, or any other good idea that could help in this scenario? 回答1: You could use Thrift to serialize your objects and then use IPC method of your liking(named pipe,message queues etc). The following is a simple example using pipes We have a an object of type

Qt portable IPC: only QSharedMemory?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 18:19:18
I'm looking for suggestions about choosing a portable way to achieve local IPC in a robust way, since i'm new to C++ and would like to avoid common pitfalls of fiddling with shared memory and locks; therefore I was thinking about message-passing style ipc. I was planning to use qt for other reasons anyway, thus i took a peek to Qt ipc options. if i understand correctly qt doesn't offer a completely portable message-passing ipc feature. it can use d-bus, but using it on windows would be a problem. other ways are limited to embedded linux platforms (and i would like to port this thing to AIX). I

.Net 3.5, most secure way to pass string between processes

て烟熏妆下的殇ゞ 提交于 2019-12-05 18:12:24
I'd like to be able to pass a SecureString (a cached passphrase) to a child process in C# (.Net 3.5), but I don't know what the most secure way is to do it. If I were to convert the SecureString back to a regular string and pass it as a command-line argument, for example, then I think the value may be prone to disk paging--which would make the plaintext touch the filesystem and ruin the point of using SecureString. Can the IntPtr for the SecureString be passed instead? Could I use a named pipe without increasing the risk? In general you should define your threat model before worrying about

java inter-process communication

邮差的信 提交于 2019-12-05 16:15:38
is it possible to use run a java class in command line to run a certain class or function in a running swing? such as , when java Test asd will setText a running swing Jlabel to asd The most straight forward way is to create an RMI method call. It's built into java from the beginning, reasonably simple and lightweight. The two programs run in separate processes. You will need to create an interface between the processes (or as Matthew put it: implement inter-process communication ). There are millions of ways to achieve this, just to name a few: Create a file-based interface (Test will write

IPC之共享内存

*爱你&永不变心* 提交于 2019-12-05 14:50:17
在多进程程序中(vfork创建的多进程除外),即使是全局变量也无法共享,各个进程都会保存局部变量或全局变量的副本,供自己使用。 共享内存将文件地址映射到内存中即可让多个进程共享内存中的数据。 内存映射API #include<sys/mman.h> void *mmp(void *addr, size_t len, int prot, int flags, int fd, off_t offset);//调用成功则返回被映射区的起始地址,出错则为MAP_FAILED addr可以指定描述符fd应被映射到的进程内空间的起始地址。它通常被指定为一个空指针,这样告诉内核自己去选择起始地址。无论那种情况,该函数的返回值都是描述符fd所映射到内存区的起始地址。 使用例程 #include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<sys/types.h> #include<sys/stat.h> #include<sys/mman.h> #include<fcntl.h> #include<semaphore.h> #define SEM_NAME "mysem" int main(int argc, char *argv[]) { int fd, i, nloop, zero = 0; int *ptr; sem_t

How to send a data.frame from R to Q/KDB?

…衆ロ難τιáo~ 提交于 2019-12-05 14:08:10
I have a large data.frame (15 columns and 100,000 rows) in an existing R session that I want to send to a Q/KDB instance. From KDB's cookbook , the possible solutions are: RServer for Q : use KDB to create new R instance which shares memory space. This doesn't work because my data is in an existing instance of R. RServe : run an R server and use TCP/IP to communicate with Q/KDB client. This does not work, because as per RServe's documentation , " every connection has a separate workspace and working directory " and so i presume does not see my existing data. R Math Library : access R's