ipc

communication between 2 browser windows in electron

北战南征 提交于 2020-01-02 21:08:20
问题 I need to build an app that will span across multiple monitor screens, something like this: Electron suports multiple windows but how to comunicate between them? 回答1: The main thing to remember is that in Electron, interProcess communication is done by ipcMain (in the main process) and ipcRenderer(in all the created windows). Like below: From what i've seen in the GitHub comments - direct communication between the Renderer instances is not allowed. Everything must pass trough the mainProcess.

How to optimize multithreaded program for use in LSF?

岁酱吖の 提交于 2020-01-02 10:00:24
问题 I am working on a multithreaded number crunching app, let's call it myprogram . I plan to run myprogram on IBM's LSF grid. LSF allows a job to scheduled on CPUs from different machines. For example, bsub -n 3 ... myprogram ... can allocate two CPUs from node1 and one CPU from node2. I know that I can ask LSF to allocate all 3 cores in the same node, but I am interested in the case where my job is scheduled onto different nodes. How does LSF manage this? Will myprogram be run in two different

Sharing data across processes on linux

﹥>﹥吖頭↗ 提交于 2020-01-02 05:41:10
问题 In my application, I have a process which forks off a child, say child1, and this child process writes a huge binary file on the disk and exits. The parent process then forks off another child process, child2, which reads in this huge file to do further processing. The file dumping and re-loading is making my application slow and I'm thinking of possible ways of avoiding disk I/O completely. Possible ways I have identified are ram-disk or tmpfs. Can I somehow implement ram-disk or tmpfs from

java inter-process communication

杀马特。学长 韩版系。学妹 提交于 2020-01-02 05:38:10
问题 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 回答1: The most straight forward way is to create an RMI method call. It's built into java from the beginning, reasonably simple and lightweight. 回答2: 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 ).

How to structure communication between Nodejs server and rails?

ε祈祈猫儿з 提交于 2020-01-02 04:51:14
问题 I am currently using rails to serve static web pages and I am experimenting with NodeJs to handle some real time aspect of my application. I have been able to have do a one way communication between Nodejs to my Rails server by having Nodejs write to a db and my rails server reading from it. Now I want to do the other way, aka an action in Rails will trigger an action in Nodejs. Obviously I can be dumb and have a node continually polling the database server. What are my options? Set up RPC

Python 2.6: Process local storage while using multiprocessing.Pool

纵饮孤独 提交于 2020-01-01 19:36:30
问题 I'm attempting to build a python script that has a pool of worker processes (using mutiprocessing.Pool) across a large set of data. I want each process to have a unique object that gets used across multiple executes of that process. Psudo code: def work(data): #connection should be unique per process connection.put(data) print 'work done with connection:', connection if __name__ == '__main__': pPool = Pool() # pool of 4 processes datas = [1..1000] for process in pPool: #this is the part i'm

How to filter a lot of data with IPC::Open2?

浪尽此生 提交于 2020-01-01 19:12:30
问题 My task is to filter some data from perl script with external utility (the addr2line). The data size is quite large. I need to print a lot of data to stdin of program and read a lot of data back (from stdout of program into my script). Now I do this with IPC::Open2 , but I don't mix reading and writing. Is this legal? Will Open2 buffer any size of data in pipe? My code: my $cmd="addr2line -e $prog_name "; use IPC::Open2; local (*Reader, *Writer); my $pid = open2(\*Reader, \*Writer, $cmd); for

Linux进程间通信

一曲冷凌霜 提交于 2020-01-01 16:10:02
写在前面 为什么 要进行进程间通信? 因为进程间具有独立性(每一个进程都有自己的虚拟地址空间,进程A并不知道进程B的虚拟地址空间中的内容),因此导致了进程之间协作的问题 进程间通信的 目的 : 数据传输:一个进程需要将它的数据发送给另一个进程 数据共享:多个进程间需要共享同样的数据、资源 进程控制:一个进程希望完全控制另一个进程的执行,此时控制进程希望能够拦截另一个进程的所有陷入和异常,并能够及时知道它的状态改变 进程间通信 分类 : 管道 System V IPC POSIX IPC 网络 是当前最大的进程间通信 本篇文章中只针对管道及System V中的共享内存、消息队列和信号量进行解释 管道 概念: 我们把从一个进程连接到另一个进程的一个数据流称为一个管道 管道是Unix中最古老的进程间通信的形式。它本质是一个内核中的内存,也可以将这块内存称为缓冲区,当其中的数据被读走后,管道就为空 管道是半双工的,即数据只能由一个流向 匿名管道 # include <unistd.h> int pipe(int fd[2]); 功能:创建一个匿名管道 参数:fd[]:文件描述符数组,fd[0]表示读端,fd[1]表示写端,使用这一对文件描述符访问内存 返回值:成功返回0,失败返回-1 【注】: 1、pipe()函数的参数是 输出型参数 ,也就是意味着需要传入一个int类型数组,数组大小为2

How to fire events in a Delphi application from another Delphi application?

a 夏天 提交于 2020-01-01 11:55:12
问题 Please read before tagging as duplicate . I'm creating a set of applications which rely on smart cards for authentication. Up to now, each application has controlled the smart card reader individually. In a few weeks, some of my customers will be using more than one application at the same time. So, I thought maybe it would be more practical to create a service application which controls the authentication process. I'd like my desktop applications to tell the service application they are

Shared memory and IPC [closed]

只愿长相守 提交于 2020-01-01 09:45:47
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 months ago . I was reading a tutorial about shared memory and found the following statement: "If a process wishes to notify another process that new data has been inserted to the shared memory, it will have to use signals, message queues, pipes, sockets, or other types of IPC.". So what is