I wrote about it before, because of work reasons and busy writing my graduation design. Until now. This impulse suddenly ended up writing the following. In fact, writing it here is just taking a note and leaving your thoughts --
We have mentioned several methods, but also the following methods to implement inter-process communication:
Iv. Shared Memory
Shared Memory can also implement inter-process communication. Memory blocks that can be browsed by other processes. Other processes that want to access this memory block request access to it, or the process that creates it grants the access permission to the memory block. All processes that can access a specific memory block have immediate visibility into it. The shared memory is mapped to the address space of each process that uses it. So it looks like another variable declared in the process. When a process writes shared memory, all processes immediately know the written content and can access it.
The relationship between shared memory between processes is similar to the relationship between global variables between functions. All functions in the program can use the value of global variables. Similarly, shared memory blocks can be accessed by all processes in progress. A memory block may share a logical address, and a process may also share some physical addresses.
The creation of shared memory blocks must be completed by a system API call. In the WIN32 environment, the CreateFileMapping (), MapViewOfFile (), and MapViewOfFileEx () APIs can be used well.
The shared memory is allocated in the WIN32 system ~ Within the 3 GB address range. Once MapViewOfFile () and MapViewOfFileEx () are called, all processes of the shared file ing object can access this memory block immediately and read and write this memory block as needed.
5. Dynamic Data Exchange
Dynamic Data Exchange is one of the most powerful and complete forms of inter-process communication. Dynamic Data Exchange uses message transmission, shared memory, transaction protocol, customer/Server category, synchronization rules, and Session Protocol to allow data and control information to flow between processes. The basic model of Dynamic Data Exchange SESSION (DDE) is the customer and server. The server responds to data or actions from customers. Customers and servers can communicate with each other in multiple ways.
A server can communicate with any number of customers. A customer can also communicate with any number of servers. A single DDE proxy can be either a customer or a server. That is to say, a process can request a service from a DDE proxy that is executing services for another process.
Here we will briefly introduce it here, just describe the form. --Sleep.