interprocess

circular_buffer and managed_mapped_file segmentation fault

一世执手 提交于 2021-02-05 08:08:42
问题 I am using boost 1.73.0, and am trying to use circular_buffer together with manage_mapped_file to store strings in a circular buffer persisted on disk. I do the following to create/open the circular_buffer: boost::interprocess::managed_mapped_file mmf(boost::interprocess::open_or_create, "./circ_buffer.bin", 10u << 10); typedef boost::interprocess::allocator<std::string, boost::interprocess::managed_mapped_file::segment_manager> string_allocator; typedef boost::circular_buffer<std::string,

Interprocess communication in Lua with Example?

霸气de小男生 提交于 2021-01-21 10:26:32
问题 I have been struggling a lot to get this to work. Can someone provide an example with any LUA api of 2 scripts that pass a message back and forth. I have tried Oil, lua-ipc and zeromq. But I face several missing libraries issues. The ultimate goal is to pass a vector of numbers from one Lua process to another Lua process (with a different version of Lua) without going through disk. Here is a similar example in python of IPC in a single file. Something similar in lua would be extremely helpful

How to use named pipes in C# correctly — several connections, server recreation etc

最后都变了- 提交于 2020-08-02 06:58:21
问题 I need to implement an inter-process communication between C# applications. I decided to use named pipes and wrote the following code: Server while (true) { using (var server = new NamedPipeServerStream("some_pipe")) { server.WaitForConnection(); using (var reader = new StreamReader(server)) { string line = reader.ReadLine(); MessageBox.Show(line); } } } Client using (var client = new NamedPipeClientStream("some_pipe")) { client.Connect(); using (var writer = new StreamWriter(client)) {

Interprocess communication with SPSC queue in python

天涯浪子 提交于 2020-01-06 05:22:09
问题 I have multiple write-heavy Python applications ( producer1.py , producer2.py , ...) and I'd like to implement an asynchronous, non-blocking writer ( consumer.py ) as a separate process, so that the producers are not blocked by disk access or contention. To make this more easily optimizable, assume I just need to expose a logging call that passes a fixed length string from a producer to the writer, and the written file does not need to be sorted by call time. And the target platform can be

unordered_map with string in managed_shared_memory fails

☆樱花仙子☆ 提交于 2020-01-06 03:08:30
问题 This is my code: int main (int argc, char *argv[]) { typedef int KeyType; typedef string MappedType; typedef std::pair<KeyType, MappedType> ValueType; typedef boost::interprocess::allocator<ValueType, boost::interprocess::managed_shared_memory::segment_manager> ShmAlloc; typedef boost::unordered_map<KeyType, MappedType, boost::hash<KeyType>, std::equal_to<KeyType>, ShmAlloc> ShmHashMap; boost::interprocess::managed_shared_memory segment(boost::interprocess::open_or_create,

Communicate data between C and Python apps running continuously

…衆ロ難τιáo~ 提交于 2020-01-06 02:36:10
问题 Is there a way to pass data between continuously running C program and continuously running Python program? It is crucial that C program starts first. So far I have (for C side): void run_cmd(char *cmd[]) { int parentID = getpid(); char str[1*sizeof(double)]; sprintf(str, "%d", parentID); char* name_with_extension; name_with_extension = malloc(2+strlen(cmd[1])+1*sizeof(int)+1); strcat(name_with_extension, cmd[1]); strcat(name_with_extension, " "); strcat(name_with_extension, str); pid_t pid;

Redirect FFMPEG's output to multiple named pipes on Windows

大兔子大兔子 提交于 2020-01-04 02:16:15
问题 I am trying to stream video and audio data into two separate named pipes on Windows. ffmpeg.exe -f dshow -i video="My camera name":audio="My microphone name" -map 0:1 -ac 1 -f f32le \\.\pipe\audioStream -map 0:0 -f mjpeg \\.\pipe\videoStream The problem is that FFMPEG does not seem to understand that the outputs \\.\pipe\audioStream and \\.\pipe\videoStream are pipes and treats them like files. If the pipes are already created when the FFMPEG starts, it wants to overwrite them and fails.

Inter Application Communication in Android

僤鯓⒐⒋嵵緔 提交于 2020-01-02 10:28:28
问题 I have an activity in one application that calls the activity of another application. How can be done with intent or any other way. For example in single application, we can do it like: Intent i = new Intent(this, ActivityTwo.class); i.putExtra("Value1", "This value is sent by FirstActivity "); 回答1: Declare android action for the Second Activity and call the Second Activity from First Activity through the Action name. For more info see the below example: Declared Second Activity in

In-Proc COM object sharing across another Process

假如想象 提交于 2019-12-29 04:54:19
问题 Before I ask this question I would like to make it clear that I know there are libraries and techniques for Inter process communcation. This though, is a learning question about COM. I also do know about out-of-proc servers but that's not what I am looking for. The question: What I want to know, because I don't know this, is it possible, and if yes how, to share an in-proc COM object (object defined in a DLL) living in one process (has been instantiated in the process) across another process?

Shared but Secure Memory between 3 Different Apps (Windows)

大憨熊 提交于 2019-12-26 06:50:53
问题 We are writing a set of application for windows which contains IE toolbar, Firefox toolbar and Windows Desktop client. Before using any of these components user provides his secret code and says that he need to save this code for 1hr or whatever option he chooses. Now the challenge for us is that we have to use the same secret code to decrypt his data while he uses in all 3 component, Currently we are writing that secret key in a plain file with AES encryption with a specific key buried in