ipc

communication between two flex apps

久未见 提交于 2020-01-23 06:38:45
问题 I have 2 flex apps on the same page. I want them to be able to call each other's public functions. I am thinking of using either externalInterface calls or FaBridge to do so. Is there a better way to do it? 回答1: The best way to go is to use LocalConnection. It allows you to call methods from a separate SWF without having to go through Javascript or a server. Tip: if you're going to be sending arguments that are greater than about 20KB in size, you will want to split them up in two or more

Can socket objects be shared with Python's multiprocessing? socket.close() does not seem to be working

大兔子大兔子 提交于 2020-01-22 15:30:25
问题 I'm writing a server which uses multiprocessing.Process for each client. socket.accept() is being called in a parent process and the connection object is given as an argument to the Process. The problem is that when calling socket.close() the socket does not seem to be closing. The client's recv() should return immediately after close() has been called on the server. This is the case when using threading.Thread or just handle the requests in the main thread, however when using multiprocessing

序列化与反序列化

末鹿安然 提交于 2020-01-20 18:10:24
为什么我们需要序列化 存储/传输 IPC/RPC IPC,Inter-Process Communication,进程间通信 RPC,Remote Procedure Call,远程过程调用 序列化的类型 文本 字节 ProtoBuf 来源: https://www.cnblogs.com/johnnyzhao/p/12218845.html

漫谈消息队列

爱⌒轻易说出口 提交于 2020-01-20 01:55:40
消息队列 今天电话面试,被问及,为什么你框架设计都是用线程创建,不用进程。我说产品比较简单,没必要做那么多。现在想想这样的回答的确肤浅。 在聊进程间通讯前,先说下选用进程和线程的规章, 进程与线程的选择取决以下几点: 1、需要频繁创建销毁的优先使用线程;因为对进程来说创建和销毁一个进程代价是很大的。 2、线程的切换速度快,所以在需要大量计算,切换频繁时用线程,还有耗时的操作使用线程可提高应用程序的响应 3、因为对CPU系统的效率使用上线程更占优,所以多机分布的用进程,多核分布用线程; 4、并行操作时使用线程,如C/S架构的服务器端并发线程响应用户的请求; 5、需要更稳定安全时,适合选择进程;需要速度时,选择线程更好。 说白了就是:进程是独立堆栈,开销大。线程共享,响应快。由于线程共享,一个线程挂了,进程就挂了。进程独立,所以互不影响。**总结就是第五点:** 需要更稳定安全时,适合选择进程;需要速度时,选择线程更好 那么既然是进程,那么进程间如何通讯呢? 进程通信有好多方式:管道,共享内存,消息队列,信号,套接字。 这里说下消息队列,这个是系统维护的IPC,也就说这是系统方法,不需要用户维护,可以理解成工具。 先说几个标准函数: ftok函数: key_t ftok(const char *pathname, int proj_id); 功能:生成一个key(键值),唯一的。 参数

Linux: OS support for an unprivileged interprocess bus

♀尐吖头ヾ 提交于 2020-01-17 03:25:11
问题 I'm trying to find a simple solution for high-performance broadcast/multicast communication between unprivileged processes running on a Linux host. I'm looking for a solution that is 1) simple, 2) unprivileged (no root), 3) language-independent, 4) packet-oriented and 5) efficient (Gbit/s and up). To put this in context, my existing code simply uses UDP sockets for unicast communication, which neatly matches the above requirements (except being unicast). I've looked into expanding this to

进程间通信(IPC)

流过昼夜 提交于 2020-01-17 01:03:50
进程间通信(Interprocess communication) 一、概述: 进程的用户空间是互相独立的,一般而言是不能互相访问的,唯一的例外是共享内存区。进程间通信是一组编程接口,让程序员能够协调不同的进程,使之能在一个操作系统里同时运行,并相互传递、交换信息。这使得一个程序能够在同一时间里处理许多用户的要求。因为即使只有一个用户发出要求,也可能导致一个操作系统中多个进程的运行,进程之间必须互相通话。IPC接口就提供了这种可能性。每个IPC方法均有它自己的优点和局限性,一般,对于单个程序而言使用所有的IPC方法是不常见的。 二、目的: (1)数据传输:一个进程需要将它的数据发送给另一个进程,发送的数据量在一个字节到几兆字节之间。 (2)共享数据:多个进程想要操作共享数据,一个进程对共享数据的修改,别的进程应该立刻看到。 (3)通知事件:一个进程需要向另一个或一组进程发送消息,通知它(它们)发生了某种事件(如进程终止时要通知父进程)。 (4)资源共享:多个进程之间共享同样的资源。为了作到这一点,需要内核提供锁和同步机制。 (5)进程控制:有些进程希望完全控制另一个进程的执行(如Debug进程),此时控制进程希望能够拦截另一个进程的所有陷入和异常,并能够及时知道它的状态改变。 进程通过与内核及其它进程之间的互相通信来协调它们的行为。Linux支持多种进程间通信(IPC)机制

COM Interop with IPC in C#

你离开我真会死。 提交于 2020-01-16 00:26:40
问题 I have a question about IPC with COM Interop objects. I want to create and fill with data COM Interop object in one process (for example Windows Service written in C#). Then I want to get it in another process (console application in C#). I know that COM objects don't serialize and they are unmanaged code. I tried realize solution by .Net Remoting (Windows Service is server, console application is client), but I couldn't get COM Interop object in client (I made .net class inherited from

Are signals generated by OS kernels or processes?

隐身守侯 提交于 2020-01-15 16:47:49
问题 https://en.wikipedia.org/wiki/Unix_signal says Signals are a limited form of inter-process communication used in Unix, Unix-like, and other POSIX-compliant operating systems. A signal is an asynchronous notification sent to a process or to a specific thread within the same process in order to notify it of an event that occurred. ... The kernel can generate signals to notify processes of events. For example, SIGPIPE will be generated when a process writes to a pipe which has been closed by the

Qt: Not registered qRegisterMetaType()

前提是你 提交于 2020-01-15 05:48:46
问题 Im new in Qt and im trying to execute a program in a python subprocess: class MiThread(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self): try: from Queue import Queue, Empty except ImportError: #from queue import Queue, Empty # python 3.x print "error" ON_POSIX = 'posix' in sys.builtin_module_names def enqueue_output(out, queue): for line in iter(out.readline, b''): queue.put(line) out.close() p= Popen(["java -Xmx256m -jar bin/HelloWorld.jar"],cwd=r'/home

FIFO - Restore communication in C ++

寵の児 提交于 2020-01-15 03:47:47
问题 I have a main program written in C ++. It triggers child programs using vfork () and execl (). Communication between them works perfectly using FIFO (the parent writes and the child reads). In the main program the sequence for establishing communication is if (mkfifo(CONTROLLER_file, 0666) < 0) perror("mkfifo"); if((aux_fd = open(CONTROLLER_file, O_RDONLY | O_NONBLOCK) )< 0) perror("Opening error"); if((fd = open(CONTROLLER_file, O_WRONLY)) < 0) perror("Opening error"); I do this to avoid the