shared-memory

Trouble reading from Memory Mapped File

时光怂恿深爱的人放手 提交于 2019-12-07 02:37:52
问题 I am trying to implement a Memory Mapped File within my application (specifically a Windows Service), and then use a C# form to read from MMF the service writes to. Unfortunately i cannot seem to get the form to read anything from the MMF, more importantly it seems that the form never finds the MMF created by the Service. Below are code snippets that outline what im doing, can anyone see what I am doing wrong or be able to point me in a better direction? Service : private MemoryMappedFile mmf

Why is communication via shared memory so much slower than via queues?

蹲街弑〆低调 提交于 2019-12-06 20:07:48
问题 I am using Python 2.7.5 on a recent vintage Apple MacBook Pro which has four hardware and eight logical CPUs; i.e., the sysctl utility gives: $ sysctl hw.physicalcpu hw.physicalcpu: 4 $ sysctl hw.logicalcpu hw.logicalcpu: 8 I need to perform some rather complicated processing on a large 1-D list or array, and then save the result as an intermediate output which will be used again at a later point in a subsequent calculation within my application. The structure of my problem lends itself

Accessing variable in kernel-space from user-level space

不问归期 提交于 2019-12-06 16:06:12
So let's I have a struct that I want to read from user-level space that is defined in the kernel-space, but the user-level space has multiple processes. Example: In a kernel module, I have a global struct. struct { int a; int b; } test; In a user-level module, I have "externed" that global struct extern struct { int a; int b; } test; Compiler doesn't complain, and linkage editor doesn't complain. However, if the user has multiple processes, then is that struct cloned for each process? If I use shared memory along with extern, then I could access the kernel's struct, and if I have n processes,

How to get the content of a Section object in a kernel dump

一世执手 提交于 2019-12-06 14:12:34
The section object from a 3thParty vendor is named rpsPdf10.mutex and it's intended use is to mimic a semaphore by writing a Boolean flag to it. Using LiveKd and with a lot of help from SO, I've issued following command's trying to get detailed info of this Section object. 0: kd>!process 0 0 3thParty.exe ... PROCESS fffffa800ea80060 SessionId: 0 Cid: 0a00 Peb: fffdf000 ParentCid: 014c DirBase: 99349000 ObjectTable: fffff8a004448bf0 HandleCount: 338. Image: 3thParty.exe ... 0: kd> !handle 0 7 fffffa800ea80060 ... 08 fffff8a012e26710 Section rpsPdf10.mutex ... 0: kd> !object fffff8a012e26710

Checking fork behaviour in python multiprocessing on Linux systems

时光毁灭记忆、已成空白 提交于 2019-12-06 13:41:11
I have to access a set of large and not pickable python objects from many processes. Therefore, I would like to ensure that these objects are not copied completely. According to comments in this and this post, objects are not copied (on unix systems) unless they are changed. However, referencing an object will change its reference count, which in turn will then be copied. Is this correct so far? Since my concern is due to the size of my large objects, I do not have a problem, if small parts of these objects are copied. To ensure that I understood everything correctly and that nothing

Using Thrift for IPC-Communication via shared Memory

吃可爱长大的小学妹 提交于 2019-12-06 12:12:13
问题 I couldn't find a sufficient example on how to use apache thrift for ipc-communication via shared memory. My goal is to serialize an exisiting class with help of thrift, then send via shared memory to a different process where i deserialize it again with help of thrift. Right now i'm using TMemoryBuffer and TBinaryProtocol to serialize the data. Although this works, I have no idea on how to write it to shared memory. Here is my code so far: #include "test_types.h" #include "test_constants.h"

Sharing executable memory pages in Linux?

无人久伴 提交于 2019-12-06 09:42:23
Is it possible to share executable pages on Linux for the sake of preserving space? I know that there are shared memory APIs that can be used to share memory between different processes but I don't think that is meant to be used for that. Basically, I want to have a shared memory region where some commonly used shared libraries can be loaded into. I want to get the dynamic linker to link against the preloaded (read only) images instead of having to load all of the shared library images into every single process (which seems like a waste). Is this possible on the Linux kernel? The Darwin kernel

one-to-many IPC

妖精的绣舞 提交于 2019-12-06 09:29:08
问题 I'm looking for an ipc mechanism which would allow high throughput of data updates from one process to many (thousands). The 'server' process would be responsible for updating a data structure at a high frequency. Upon update, I'd like to notify the 'client' processes of the update, and allow those processes to read the new data. Under a Linux or FreeBSD environment, what would be a good way to go about this? 回答1: I would recommend using ZeroMQ. It's a fast, lightweight, cross-platform, cross

c++ Synchronize shared memory when reading

痞子三分冷 提交于 2019-12-06 09:16:57
I want to synchronize a shared_memory_object for reading iff the shared_memory_object already exists. This is the code I am using for synchronization with a bool variable. boost::interprocess::shared_memory_object my_shared_mat; bool mat_ready = true; while (mat_ready) { try { my_shared_mat = boost::interprocess::shared_memory_object( boost::interprocess::open_only, // only open "shared_mat", // name boost::interprocess::read_only); // read-only mode mat_ready = false; } catch (boost::interprocess::interprocess_exception &ex) { std::cout << ex.what() << std::endl; mat_ready = true; } } boost:

Memory Mapped Files, Managed Mapped File and Offset Pointer

巧了我就是萌 提交于 2019-12-06 08:42:35
问题 I'm a little bit confused about the terminology of Boost Library (for windows). What I'm trying to do is simply; create a file on disk (a big file >50 GB) do some mapping for write and read operations seperately. For example first map 1 gb portion for writing & after that flush it to the hard drive take a new portion and so on, while the reader applications maps different parts of the file and do the reading stuff without changing anything (no edit). I'm reading the documentation of boost (1