Tag Info

New answers tagged

4

If you need an overview of the benefits and best-practices on move semantics, please watch some of the conference recordings on the isocpp website. (At the bottom there's a link to older recordings.) Bjarne Stroustrup provide a prime motivating example on his website. http://www.stroustrup.com/C++11FAQ.html#rval Just consider the typical implementation ...


0

Django will help you in that manner. You will redirect multiple sites to your Django instance, and the Django instance will use the API that can help you with saving through economies of scale, with VM costs/ API subscription costs, etc. In this context, I am assuming that you are not using limited free tiers, or you do not have complicated SLAs with your ...


3

But I cannot get my head around to how the boost library does this. The boost interprocess mechanism has three necessary components to work: memory-mapped file: a memory-mapped file needs to be created and passed to a boost.interprocess allocator. This allocator will take chunks of the file and use them as if they were returned by a std::allocator, ...


2

Boost uses memory mapping of a file. Both unix and windows support creation of files that don't exist on the normal file system for just this purpose. Then you will need to synchronize access to that memory like you would if different threads were to access it. Meaning concurrent reads can happen without synchronization but as soon as one process want to ...


2

Shared memory is still just memory. You can put a mutex, spinlock or any other synchronization primitive in there, and use them to synchronize your processes' access to the shared memory, exactly like threads use those primitives to synchronize access to the memory visible to them. The only real differences are: threads share all memory and the same ...


3

shared memory is not the complete picture for IPC, its a data-passing mechanism but you still need some way to inform the other process that some data has been updated and is available to be read. How you do this is up to you, typically you'd use an OS mutex or event object, each process waits on this to be set, the application writing sets it once its ...


2

Notice that C and C++ are different languages. Shared memory is impossible in purely standard C11, or C++11 (since the standard does not define that), or even C++14 (whose n3690 draft, and presumably official standard, does not mention shared memory outside of multi-threading). So you need extra libraries to get shared memory. But some operating systems ...


-1

Although most answers approach from the side of software and/or hardware model, the cleanest way is to consider how the physical RAM chips work. (The cache is located between the processor and the memory, and simply uses the same address bus, and its operation is completely transparent for the processor.) RAM chips have one single address decoder, which ...


6

C++ can do it the same way C does. All C++ gives you is easier-to-use containers that wrap much of the low-level detail. For example, a string class can (and does) hold a block of memory on the stack for short strings, only allocating a heap buffer for larger ones. This buffer is exactly like a C string buffer, if the string resizes, the string class will ...



Top 50 recent answers are included