interprocess

Inter-process event emitter for Node.js?

有些话、适合烂在心里 提交于 2019-11-29 19:53:58
问题 At the moment, I am using EventEmitter2 as a message bus inside my application, and I really like it. Anyway, now I need a message bus which does not only work in-process, but also inter-process. My ideal candidate would … … be API-compatible to EventEmitter2 (a "drop-in replacement"), … work without a dedicated server or external service (such as a database, a message queue, …), only using OS resources, … be written in pure JavaScript, … run in-memory, so it does not require persistence.

C++ application: Is it possible to pass accepted TCP connection from one process to another?

不问归期 提交于 2019-11-29 10:40:46
So I wonder - is it possible to pass accepted TCP connection (on Windows or Unix like OS) from one process to another? Here the point is to pass connection - not data in a way a proxy app would. On Windows, use WSADuplicateSocket , pass the filled in WSAPROTOCOL_INFO to the other process, use WSPSocket to recreate a socket. On unix-like OS'es this is possible using the sendmsg() system call. libancillary abstracts this for you. Fred Foo In Unix, a TCP connection is represented as a socket file descriptor. When you fork a process, the file descriptors are inherited by the child process,

Trouble with boost::lockfree::queue in shared memory (boost 1.53, gcc 4.7.2 / clang 3.0-6ubuntu3)

橙三吉。 提交于 2019-11-29 10:00:46
I have a problem with placing boost::lockfree::queue<<T, fixed_sized<false>, ..> in shared memory. I need it because I have to be able to insert more than 65535 messages into the queue, and fixed_sized queue is limited with 65535. The following code works properly (but capacity<...> option implies fixed_sized<true> ): typedef boost::interprocess::allocator< MessageT, boost::interprocess::managed_shared_memory::segment_manager> ShmemAllocator; typedef boost::lockfree::queue< MessageT, boost::lockfree::capacity<65535>, boost::lockfree::allocator<ShmemAllocator> > Queue; m_segment = new boost:

In node.js, how to declare a shared variable that can be initialized by master process and accessed by worker processes?

扶醉桌前 提交于 2019-11-28 11:55:13
I want the following During startup, the master process loads a large table from file and saves it into a shared variable. The table has 9 columns and 12 million rows, 432MB in size. The worker processes run HTTP server, accepting real-time queries against the large table. Here is my code, which obviously does not achieve my goal. var my_shared_var; var cluster = require('cluster'); var numCPUs = require('os').cpus().length; if (cluster.isMaster) { // Load a large table from file and save it into my_shared_var, // hoping the worker processes can access to this shared variable, // so that the

Object Sharing between Applications?

大憨熊 提交于 2019-11-28 07:03:47
Let's say I have a large data array updated 1000+ times per second. Another application wants to access and read the array in a short interval. Both applications are on the same machine. I have tried using WCF for interprocess communication, but serializing and sending the whole array (or a large object) thousands of times per second is unfeasible performance wise. Is there a way to directly access objects from different applications in c#? There are a few IPC technologies you can use that though pre-date WCF are still relevant today. Pipes Pipes is one such technology. It's binary, runs in

Interprocess Communication using Named Pipes in C# + PHP

江枫思渺然 提交于 2019-11-28 04:53:19
问题 Interprocess Communication using Named Pipes in C# is easy, but im not exactly sure how to do this in php, or if its even possible. so i have these questions: Is named pipes possible in php? Is it possible to have a C# named pipe client, connect to a php named pipe server? how the heck would i code that? :) an answer to any of the above questions would be so helpful.. thanks :) edit: Its a stand alone php program, not a web-based app. edit2: The named pipe server can be in the C# side, or the

What's the most efficient node.js inter-process communication library/method?

一笑奈何 提交于 2019-11-27 10:31:37
We have few node.js processes that should be able to pass messages, What's the most efficient way doing that? How about using node_redis pub/sub EDIT: the processes might run on different machines Leonid Beschastny If you want to send messages from one machine to another and do not care about callbacks then Redis pub/sub is the best solution. It's really easy to implement and Redis is really fast. First you have to install Redis on one of your machines. Its really easy to connect to Redis: var client = require('redis').createClient(redis_port, redis_host); But do not forget about opening Redis

What is the easiest way to do inter process communication in C#?

為{幸葍}努か 提交于 2019-11-27 05:02:27
I have two C# applications and I want one of them send two integers to the other one (this doesn't have to be fast since it's invoked only once every few seconds). What's the easiest way to do this? (It doesn't have to be the most elegant one.) The easiest and most reliable way is almost certainly IpcChannel (a.k.a. Inter Process Communication Channel); that's what it's there for. You can get it up and running with a couple of lines of code and configuration. Groo You can try .NET Remoting. Here is a simple example: CodeProject .NET Remoting . If you are using .NET 3.5, you should go for WCF,

How to I create a boost interprocess vector of interprocess containers?

余生长醉 提交于 2019-11-27 03:40:06
问题 I like to create a boost interprocess vector of classes containing a interprocess container. The following code works until the resize function call and of course because my class has not default constructor. How to I resolve this problem? The example is based on the boost Containers of containers example Thanks Markus #include <boost/interprocess/managed_shared_memory.hpp> #include <boost/interprocess/allocators/allocator.hpp> #include <boost/interprocess/containers/map.hpp> #include <boost

What's the most efficient node.js inter-process communication library/method?

半世苍凉 提交于 2019-11-26 22:19:36
问题 We have few node.js processes that should be able to pass messages, What's the most efficient way doing that? How about using node_redis pub/sub EDIT: the processes might run on different machines 回答1: If you want to send messages from one machine to another and do not care about callbacks then Redis pub/sub is the best solution. It's really easy to implement and Redis is really fast. First you have to install Redis on one of your machines. Its really easy to connect to Redis: var client =