shared-memory

Can you iterate a DataFrame without copying memory?

早过忘川 提交于 2019-12-08 12:48:18
问题 I am launching a Process that fetches a couple of gigs of data from a database into a DataFrame with a date index. From there I create a Manager to store that data and call a function using a Pool to utilize CPU cores. Since I have so much data, I need to use shared memory for the pooled methods to work on. import multiprocessing as mp import pandas as pd # Launched from __main__ class MyProcess(mp.Process): def calculate(): # Get and preprocess data allMyData = <fetch from Mongo> aggs =

Programming in UNIX - Semaphores,shared memory in C

安稳与你 提交于 2019-12-08 12:42:24
I started a week ago understanding and working with semaphores and shared memory, and actually created this program, the problem is i cant find anything wrong with it i been looking at it for hours and everything seems correct.. The code compiles and i can create the build but when i execute it nothing happens ... #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/ipc.h> #include <sys/shm.h> #include <stdio.h> #include <sys/fcntl.h> #include <semaphore.h> #define MAXCHILDS 4 #define MAX_SIZE 10 #define MAX_WRITES 4 typedef struct{ int m[MAX_SIZE][MAX_SIZE]; } matrix; /

Entry function uses too much shared data (0x8020 bytes + 0x10 bytes system, 0x4000 max) - CUDA error

旧街凉风 提交于 2019-12-08 12:18:47
问题 I am using Tesla C2050, which has a compute capability 2.0 and has shared memory 48KB . BUt when I try to use this shared memory the nvcc compiler gives me the following error Entry function '_Z4SAT3PhPdii' uses too much shared data (0x8020 bytes + 0x10 bytes system, 0x4000 max) My SAT1 is the naive implementation of scan algorithm, and because I am operating on images sizes of the order 4096x2160 I have to use double to calculate the cumulative sum. Though Tesla C2050 does not support double

Shared Memory Library -lrt in C on macOS

孤街浪徒 提交于 2019-12-08 08:02:00
问题 I'm doing a university assignment on shared memory on C, I need to use the functions shm_open() , mmap() , ftruncate() , shm_unlink() , etc. using a Mac with macOS Mojave 10.14 My teacher told me I need to use the -lrt library in my Makefile to make it work but when I "make" I got an error which goes ld: library not found for -lrt clang: error: linker command failed with exit code 1 Is the library spelled work? If I don't have it, I need to download it? Do I even need a specific library? (

CUDA: bad performance with shared memory and no parallelism

拟墨画扇 提交于 2019-12-08 07:27:00
问题 I'm trying to exploit shared memory in this kernel function, but the performance are not as good as I was expecting. This function is called many times in my application (about 1000 times or more), so I was thinking to exploit shared memory to avoid the memory latency. But something is wrong apparently because my application became really slow since i'm using shared memory. This is the kernel: __global__ void AndBitwiseOperation(int* _memory_device, int b1_size, int* b1_memory, int* b2_memory

Number of mapped views to a shared memory on Windows

核能气质少年 提交于 2019-12-08 07:20:46
问题 Is there a way to check how many views have been mapped on to a memory mapped file on Windows? Something like the equivalent of shmctl(... ,IPC_STAT,...) on Linux? 回答1: I had the same need to access the number of shared views. So I created this question: Accessing the number of shared memory mapped file views (Windows) You may find a solution that suits your needs there. As per Scath comment, I am going to add here the proposed solution, although merit should go to eryksun and RbMm. Making

Programming in UNIX - Semaphores,shared memory in C

孤者浪人 提交于 2019-12-08 06:19:56
问题 I started a week ago understanding and working with semaphores and shared memory, and actually created this program, the problem is i cant find anything wrong with it i been looking at it for hours and everything seems correct.. The code compiles and i can create the build but when i execute it nothing happens ... #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/ipc.h> #include <sys/shm.h> #include <stdio.h> #include <sys/fcntl.h> #include <semaphore.h> #define

Frequency limit of writing to shared memory?

萝らか妹 提交于 2019-12-08 06:18:57
问题 Single threaded application (C++) continuously locks, writes and unlocks shared memory - four times a second (the loop is programically set to run once a second and there are 4 writes in the loop and no reads). EnterCriticalSection(cs); WriteToSharedMem(); LeaveCriticalSection(cs); Another application (C) will access this shared memory once every few minutes . Are there any problems with writing to shared memory at this rate? Windows XP C++ 回答1: At this rate there definitely not! This is

Boost Interprocess share memory deletion, permissions and output files

喜你入骨 提交于 2019-12-08 05:33:43
问题 I am using Boost Interprocess library to share memory between two processes. I am using the following to allocate shared memory block, an attached vector, named mutex and a named condition variable: using ShmemAllocator = allocator<T, managed_shared_memory::segment_manager>; using MyVector = vector<T, ShmemAllocator>; segment.reset(new managed_shared_memory(create_only, blockName, numBytes)); const ShmemAllocator alloc_inst(segment->get_segment_manager()); vec = segment->construct<MyVector>

Accessing variable in kernel-space from user-level space

扶醉桌前 提交于 2019-12-08 04:32:45
问题 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