shared-memory

How to Change the Size of /dev/shm in App Engine Flexible

只愿长相守 提交于 2019-12-06 08:22:45
问题 How do you change the size of the shared memory folder /dev/shm in an App Engine Flexible app? By default it is set to 64M, too low to run many apps (e.g., chrome). I don't see any way to change it. There are ways to change it if you have access to the docker run command, but we don't have such access when launching app engine flexible apps. 回答1: A: No. Unfortunately this isn't possible (yet?) with appengine. More than a few people have run into this issue. For some reason, the container

details of MESI protocol for multicore processors

情到浓时终转凉″ 提交于 2019-12-06 07:56:55
The details of the MESI protocol for multicore processors would be really important for me, but I can't find them anywhere. Even http://www.intel.com/content/dam/doc/manual/64-ia-32-architectures-software-developer-vol-3a-part-1-manual.pdf doesn't contain enough detail. For instance: assume a private L1 and shared L2 cache. If the state of a line is exclusive in L1, then is it exclusive in L2 too (or invalid, because only in one cache could be the state of a line exclusive)? And clearly, if another core writes this line, the state of the previously exclusive line in L1 becomes invalid, but how

Max possible shared memory size in 64-bit Linux machine

妖精的绣舞 提交于 2019-12-06 06:19:23
I have 64-bit Linux machine(Intel Xeon L5410 @ 2.33GHz). **meminfo:** MemTotal: 24672736 kB MemFree: 145372 kB Buffers: 181896 kB Cached: 22004648 kB SwapCached: 195072 kB Active: 9761028 kB Inactive: 13964532 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 24672736 kB LowFree: 145372 kB SwapTotal: 17414452 kB SwapFree: 15618852 kB Dirty: 2125148 kB Writeback: 0 kB AnonPages: 1358396 kB Mapped: 1069632 kB Slab: 699464 kB CommitLimit: 29750820 kB Committed_AS: 9236252 kB PageTables: 38620 kB VmallocTotal: 34359738367 kB VmallocUsed: 17272 kB VmallocChunk: 34359718843 kB HugePages_Total: 0 HugePages

What happens to interprocess memory if one of the processes dies unexpectedly?

孤街浪徒 提交于 2019-12-06 05:27:30
问题 if you are interested in motivation Ill elaborate it in next few sentences, if not just skip to the Q. I was thinking about making fast logger but the one that is not affected when program crashes(aka few last log msgs arent lost). So my idea is to write to the shared memory(ringbuffer) and have another low prio process read from it and do the dumping. But for that to work I need to know what happens to shared memory if one process exits(normal exit, SEGFAULT)... So my question is: What

difference between slurm sbatch -n and -c

假装没事ソ 提交于 2019-12-06 04:08:55
The cluster that I work with recently switched from SGE to SLURM. I was wondering what the difference between sbatch options --ntasks and --cpus-per-task ? --ntasks seemed appropriate for some MPI jobs that I ran but did not seem appropriate for some OpenMP jobs that I ran. For the OpenMP jobs in my SLURM script, I specified: #SBATCH --ntasks=20 All the nodes in the partition are 20core machines, so only 1 job should run per machine. However, multiple jobs were running simultaneously on each node. Tasks in SLURM are basically processes / mpi ranks - it seems you just want a single task. A task

Adding an allocator to a C++ class template for shared memory object creation

北城以北 提交于 2019-12-06 02:55:41
In short, my question is: If you have class, MyClass<T> , how can you change the class definition to support cases where you have MyClass<T, Alloc> , similar to how, say, STL vector provides. I need this functionality to support an allocator for shared memory. Specifically, I am trying to implement a ring buffer in shared memory. Currently it has the following ctor: template<typename ItemType> SharedMemoryBuffer<ItemType>::SharedMemoryBuffer( unsigned long capacity, std::string name ) where ItemType is the type of the data to be placed in each slot of the buffer. Now, this works splendid when

How and when to use /dev/shm for efficiency?

早过忘川 提交于 2019-12-06 01:37:24
问题 How is /dev/shm more efficient than writing the file on the regular file system? As far as I know, /dev/shm is also a space on the HDD so the read/write speeds are the same. My problem is, I have a 96GB file and only 64GB RAM (+ 64GB swap). Then, multiple threads from the same process need to read small random chunks of the file (about 1.5MB). Is /dev/shm a good use case for this? Will it be faster than opening the file in read-only mode from /home and then passing over to the threads to do

Boost interprocess unordered_map compilation

旧城冷巷雨未停 提交于 2019-12-06 00:39:30
I'm using boost 1.53 and GCC 4.1.2 . I've tried to use boost unordered_map in some tests (documentation says, that it should work with shared memory), but i'm unable to compile my code. With interprocess::map instead of unordered everything is ok. Typedefs: typedef boost::interprocess::allocator<char, SegmentManager> CharAllocator; typedef boost::interprocess::basic_string<char, std::char_traits<char>, CharAllocator> ShmString; typedef ShmString HashKeyType; //ComplexType is a wrapper for internal interprocess::map typedef ComplexType HashMappedType; typedef std::pair<const ShmString,

Does mmap share memory with all processes?

风流意气都作罢 提交于 2019-12-05 20:38:34
When I do this : myProgram.h myProgram.c struct PipeShm { // all my fields // more // ... }; struct PipeShm myPipe = { /* initialization for all fields */ }; struct PipeShm * sharedPipe = &myPipe; void func() { sharedPipe = mmap (NULL, sizeof * sharedPipe, PROT_READ | PROT_WRITE,MAP_SHARED | MAP_ANONYMOUS, -1, 0); } When I mmap the pointer sharedPipe , if I invoke from main() any methods from myProgram code, would all processes share the exact shared memory that I shared with myPipe struct? Or would each new child that's created, would have a new myPipe of his own? Regards EDIT: This is after

Why does the compiler optimize away shared memory reads due to strncmp() even if volatile keyword is used?

爷,独闯天下 提交于 2019-12-05 20:14:58
Here is a program foo.c that writes data to shared memory. #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <stdint.h> #include <unistd.h> #include <sys/ipc.h> #include <sys/shm.h> int main() { key_t key; int shmid; char *mem; if ((key = ftok("ftok", 0)) == -1) { perror("ftok"); return 1; } if ((shmid = shmget(key, 100, 0600 | IPC_CREAT)) == -1) { perror("shmget"); return 1; } printf("key: 0x%x; shmid: %d\n", key, shmid); if ((mem = shmat(shmid, NULL, 0)) == (void *) -1) { perror("shmat"); return 1; } sprintf(mem, "hello"); sleep(10); sprintf(mem, "exit");