shared-memory

How to get memory address from memfd_create?

守給你的承諾、 提交于 2020-02-21 06:26:52
问题 In my application I need to share memory between parent and child (using fork + execl ). I use memfd_create to allocate memory, because it provides a file descriptor, which may be conveniently used in child process (the discriptor is tied to stdin via dup2 before execl ) to attach to the allocated memory. I do not use write and read - I use pointers to read and write memory directly. The only piece of the puzzle which is left to solve is how to get the address of memory, allocated via fd =

IPC mechanisms concepts

邮差的信 提交于 2020-02-20 06:16:29
问题 I want to understand these IPC mechanism concepts in OS - Shared Memory, Message System, Sockets, RPC, RMI How do different operating systems implement these. Specifically Android operating system? 回答1: IPC is inter-process communication mechanisms in OS is large discussion concept so, I think here we can't cover all this, Some Low Level stuff: The IPC mechanism discussed here is at the lowest level—all other inter-CPU IPC mechanisms use it as the base. For example, a TCP/IP connection

Managing Shared Memory in C on OSX

对着背影说爱祢 提交于 2020-02-03 10:39:43
问题 I am working on a university assignment, based largely around IPC and shared memory. The problem is, as a complete noob to C, I've been happily testing my app (which uses shmget and shmat obviously) for hours. As you can probably guess, I've not been cleaning up after myself, and now I can't run my app, because (I assume) shmget cant allocate anymore resources. My question is: how can I get this resource back without restarting OSX, and is there a GUI tool or something I can use to monitor

Managing Shared Memory in C on OSX

﹥>﹥吖頭↗ 提交于 2020-02-03 10:38:44
问题 I am working on a university assignment, based largely around IPC and shared memory. The problem is, as a complete noob to C, I've been happily testing my app (which uses shmget and shmat obviously) for hours. As you can probably guess, I've not been cleaning up after myself, and now I can't run my app, because (I assume) shmget cant allocate anymore resources. My question is: how can I get this resource back without restarting OSX, and is there a GUI tool or something I can use to monitor

Managing Shared Memory in C on OSX

拟墨画扇 提交于 2020-02-03 10:38:26
问题 I am working on a university assignment, based largely around IPC and shared memory. The problem is, as a complete noob to C, I've been happily testing my app (which uses shmget and shmat obviously) for hours. As you can probably guess, I've not been cleaning up after myself, and now I can't run my app, because (I assume) shmget cant allocate anymore resources. My question is: how can I get this resource back without restarting OSX, and is there a GUI tool or something I can use to monitor

Can you share WebAssembly memory between Web Workers?

怎甘沉沦 提交于 2020-02-01 06:33:08
问题 Is it possible to share WebAssembly.memory between 2 workers by using postMessage, something like SharedArrayBuffer? And if the answer is yes, how? 回答1: You can create a WebAssembly shared memory instance via the JavaScript API: const memory = new WebAssembly.Memory({ initial: 80, maximum: 80, shared: true }); You can then send this memory instance to a Web Worker via postMessage : const worker = new Worker("worker.js"); worker.postMessage({ memory }); The file worker.js can then create a

Connecting to SQL Server from java with TCP disabled

倾然丶 夕夏残阳落幕 提交于 2020-01-29 06:45:08
问题 I'm trying to connect to a local database (SQL Server 2008) from Java. I have disabled the tcp connections per customer requirements and I can't connect. I have to disable too the service SQL Server Browser. I write the next statement in Java: conexion = DriverManager.getConnection("jdbc:sqlserver://localhost\\SQLEXPRESS;user=user;password=password"); and I have the following error: "java.net.SocketTimeoutException: Receive timed out". (then it tells me that probably there is a firewall and

opencv matrix into shared memory

我的梦境 提交于 2020-01-24 21:18:46
问题 I want to share between two linux processes a CvMat object (a matrix in the OpenCV library), for that I'm using shared memory. One process (server) will capture a frame (matrix) from the webcam, convert it to gray scale, share it using shared memory and show the frame on the screen. The other process (client) will read the shared frame and perform some operations. See the code below. The problem seems to be that the client doesn't read the information since 'rows' and 'cols' are zero (or the

opencv matrix into shared memory

戏子无情 提交于 2020-01-24 21:17:12
问题 I want to share between two linux processes a CvMat object (a matrix in the OpenCV library), for that I'm using shared memory. One process (server) will capture a frame (matrix) from the webcam, convert it to gray scale, share it using shared memory and show the frame on the screen. The other process (client) will read the shared frame and perform some operations. See the code below. The problem seems to be that the client doesn't read the information since 'rows' and 'cols' are zero (or the

Boost Interprocess named_mutex semaphore file permissions [duplicate]

佐手、 提交于 2020-01-17 00:41:56
问题 This question already has answers here : POSIX shared memory and semaphores permissions set incorrectly by open calls (2 answers) Closed 2 years ago . I am creating my shared memory using the below, trying either to open or create and setting unrestricted permissions. void createMemory(const int numBytes) { permissions perm; perm.set_unrestricted(); segment.reset(new managed_shared_memory(open_or_create, memory_name, numBytes, 0, perm)); // Exception throw on this line mutex.reset(new named