Double CPU communication method based on shared memory

A technology of shared memory and communication method, which is applied in the field of dual-CPU communication based on shared memory, which can solve the problems that the receiver cannot calculate the number of messages, the length difference of message packets is large, and the read and write pointers are disordered, so as to improve data throughput. and processing speed, reducing the number of interrupts or queries, and reducing the effect of waiting time

Active Publication Date: 2008-01-16
SANECHIPS TECH CO LTD
View PDF0 Cites 29 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] (1) Data is generally sent in packages of fixed length. The length of the message package varies greatly. For example, the minimum length is 4 bytes, and the maximum length is 40 bytes. They must be packaged and sent according to the maximum 40 bytes, resulting in waste.
[0007] (2) When the data is not packaged and sent according to the fixed length, the length information needs to be included in the message

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Double CPU communication method based on shared memory
  • Double CPU communication method based on shared memory
  • Double CPU communication method based on shared memory

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0041] The method of the present invention will be further described below in combination with specific embodiments.

[0042] The dual-CPU communication method based on shared memory of the present invention, as shown in Figure 3 and Figure 4, for the convenience of description, the channel that CPU1 sends and CPU2 receives is defined as the forward channel, and the channel that CPU2 sends and CPU1 receives is the reverse channel . The forward channel and the reverse channel each use two circular queues, one for storing the message index and one for storing the message entity; the message index is a pointer to the message entity with a fixed size of 4 bytes, and the size of the message entity is variable .

[0043] Each circular queue is managed by a read-write pointer stored in the mailbox. The write pointer indicates that the sender can write and the receiver can only read. The read pointer indicates that the sender can only read and the receiver can write. Using mirror p...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a double-CPU communication method based on shared memorizer. A dual-way transmitting channel is arranged between a first CPU and a second CPU. Each channel uses two ring queues, with one for placing information index and the other one for placing information body; and each channel transmission includes the following steps: initialization flow: complete the initialization of the queue reading finger under the charge of the CPU; information transmission flow: write new information bodies into the queue of information body and upgrade the writing finger of information body queue, namely pointing to the usable unit behind the new information body; upgrade the content of the unit pointed by the writing finger of the information index queue, point to the new information body in the information body queue, and make the writing finger of information index queue to the next unit; and information-receiving flow. Because of introducing index queue and body queue into the shared memorizer, the invention supports the changeable length of information, thus lowering the waiting time of the sender and receiver, enhancing the utilization rate of CPU, and increasing the data throughput and handling speed.

Description

technical field [0001] The invention relates to a communication method in the technical field of communication, in particular to a dual-CPU communication method based on a shared memory. Background technique [0002] When two CPUs in the prior art communicate through a shared memory, there are currently two common methods. [0003] One method is to divide the shared storage area into two pieces, which are respectively used as the sending and receiving channels of the two CPUs, as shown in Figure 1. Each channel provides a read and write flag, which is initially writable. After sending the data, the sender changes the read-write flag from the writable state to the readable state, and waits for the receiver to receive it. After receiving the data, the receiver changes the read-write flag from the readable state to the writable state, so that the sender can continue to send. With this method, each data interaction needs to wait for the other party to finish reading or writin...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F15/167
Inventor 江帷官华伯张绪广
Owner SANECHIPS TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products