shared-memory

A use-case for synchronized(new Object())

谁说胖子不能爱 提交于 2019-12-23 09:09:40
问题 In a recent answer I suggested that it is possible to achieve the functionality of volatile by synchronizing on the object containing the variable we need to be volatile (asker does not have access to the variable in code). This got me thinking that I actually don't need to block on the containing object, I just need to achieve a memory barrier. As synchronized achieves both synchronisation and a memory barrier, if all I need is the memory barrier (as in this case) would it actually be better

fibonacci sequence using shared memory in C

江枫思渺然 提交于 2019-12-23 04:47:24
问题 I got a question to solve but it is giving me errors: 2009-EE-182-Part2.c: In function ‘main’: 2009-EE-182-Part2.c:35:13: error: expected identifier or ‘(’ before ‘->’ token 2009-EE-182-Part2.c:40:22: error: expected identifier or ‘(’ before ‘->’ token 2009-EE-182-Part2.c:41:14: error: expected identifier or ‘(’ before ‘->’ token 2009-EE-182-Part2.c:42:22: error: expected expression before ‘shared_data’ 2009-EE-182-Part2.c:44:15: error: expected identifier or ‘(’ before ‘->’ token 2009-EE-182

Microservices Architecture for highly frequent data access; in memory solutions?

不羁的心 提交于 2019-12-23 04:28:51
问题 let us define the following use case : There has to be a simulation task fulfilled, which involves an iteration/simulation over [ day1, day2, ..., dayN ]. Every step of the iteration depends on the prior step, so the order is predefined. The task has a state represented by Object1 , this object is going to be changed within every step of the iteration. The step of an iteration involves 2 different tasks: Task1 and Task2 . To fulfill Task1 , data from Database1 is required. For Task2 to be

C++ : When do I need a shared memory allocator for std::vector?

落花浮王杯 提交于 2019-12-23 03:23:32
问题 First_Layer I have a win32 dll written in VC++6 service pack 6. Let's call this dll as FirstLayer. I do not have access to FirstLayer's source code but I need to call it from managed code. The problem is that FirstLayer makes heavy use of std::vector and std::string as function arguments and there is no way of marshaling these types into a C# application directly. Second_Layer The solution that I can think of is to first create another win32 dll written in VC++6 service pack 6. Let's call

How can we share the data using shared memory segment with “Object” between two managed processes?

南笙酒味 提交于 2019-12-23 01:16:20
问题 How can I share the data between two managed processes using shared memory segments? I am using "object" inside C++/CLI code to share the data with some other part of memory in the other process. I am using following code segment. #define BUFFER_SIZE 32768 #pragma data_seg (".SHAREDMEMORY") bool _Locked = false; bool _Initialized = false; unsigned char[10000] data = NULL; #pragma data_seg() #pragma comment(linker,"/SECTION:.SHAREDMEMORY,RWS") but I need it to be: #pragma data_seg ("

Checking fork behaviour in python multiprocessing on Linux systems

余生长醉 提交于 2019-12-23 00:47:59
问题 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

details of MESI protocol for multicore processors

懵懂的女人 提交于 2019-12-22 18:15:29
问题 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

SHM replacement based on ASHMEM

情到浓时终转凉″ 提交于 2019-12-22 17:59:12
问题 I'm working on a library port from *nix to Android, and the library uses shared memory or shm . Android does not have System V shm . Instead it uses ashmem . Is anyone aware of a shim library to map shm calls into ashmem ? Google has not been very helpful. 回答1: This is how it worked for me while working with a similar problem of porting: Instead of using shmfd = open(SHM_PATH, O_RDWR) for creating and getting file descriptor I replaced it with int fd = ashmem_create_region("SharedRegionName",

c++ boost icl containers in shared memory

徘徊边缘 提交于 2019-12-22 14:16:39
问题 Im working with boost::icl::interval_map that works perfectly but i want this container to be stored in shared memory. Does boost provide support for storing boost::icl containers in shared memory using namespace std; using namespace boost::icl; struct IFM { std::string destinationGroup; int priority; IFM() { destinationGroup= ""; priority = 0; } IFM(const std::string& d, const int& p) { destinationGroup= d; priority = p; } IFM& operator +=(const IFM& right) { destinationGroup+= right

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

别等时光非礼了梦想. 提交于 2019-12-22 11:45:02
问题 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