Mailbox communication is an "indirect" communication method. Mailbox communication relies on a shared data structure outside the processes of both senders and receivers as a communication relay. The sender and receiver do not have to establish direct contact, and there is no limit on processing time; the sender can send information at any time, and the receiver can also send information at any time. Time to receive mail.
The operating environment of this tutorial: Windows 7 system, Dell G3 computer.
Mailbox communication is an "indirect" communication method.
When one thread wants to send information to another thread, the most direct way is to use global variables, but global variables are difficult to manage, and a thread wants to hang itself while waiting for information. There needs to be a convenient solution. Mailbox communication is a communication mechanism commonly used in operating systems.
#Mailbox communication: Using a shared data structure outside the processes of both the sender and the receiver as a communication relay, such as a message queue. You don't need to know the process identifier, just send the message directly to the mailbox, using an intermediary.
The biggest benefit of mailbox communication is that the sender and recipient do not have to establish direct contact, and there is no processing time limit. The sender can send messages at any time, and the receiver can receive messages at any time.
So mailbox communication is an indirect communication method.
For more related knowledge, please visit the FAQ column!
The above is the detailed content of What kind of communication method is mailbox communication?. For more information, please follow other related articles on the PHP Chinese website!