Several methods of inter-process communication)

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.