Check patentability & draft patents in minutes with Patsnap Eureka AI!

Method and system for inter-thread communication based on message queue

A message queue and inter-thread technology, which is applied in the field of inter-thread communication based on message queue, can solve the problems such as the inability to perform the push and pop command operations in the queue at the same time, resource consumption, and inability to make full use of system resources.

Active Publication Date: 2017-11-07
BEIJING QIANXIN TECH
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Therefore, the method of using mutex instructions consumes a lot of resources, and the push and pop instructions in the queue cannot be performed at the same time. One thread is always blocked by another thread and cannot make full use of system resources.

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
  • Method and system for inter-thread communication based on message queue
  • Method and system for inter-thread communication based on message queue
  • Method and system for inter-thread communication based on message queue

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0149] In order to make the above objects, features and advantages of the present invention more clearly understood, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.

[0150] In order for those skilled in the art to better understand the present invention, the related technologies involved in the present invention are briefly described below.

[0151] A thread is the smallest unit of program execution flow. A standard thread consists of thread ID, current instruction pointer (PC), register set and stack. In addition, a thread is an entity in the process, and it is the basic unit independently scheduled and dispatched by the system. The thread itself does not own system resources, but only a few resources that are necessary for running. Threads share all the resources owned by the process.

[0152] Running multiple threads simultaneously in a single program to complete different work is calle...

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 provides a method and a system for cross-thread communication based on a message queue. The method comprises the following steps: adopting the message queue to execute operations of multi-thread enqueuing push and single-thread dequeuing pop, wherein the operation of the multi-thread enqueuing push comprises the following steps: judging whether the message queue is full, and if not, respectively calculating the offset of enqueuing push of n threads, wherein the n is an positive integer more than or equal to 1; according to the offset of the enqueuing push of the n threads, respectively calculating actual positions Pos of the enqueuing push of the n threads, wherein the n threads execute enqueuing push operation respectively at the actual positions Pos of the enqueuing push. The method and system provided by the invention have the advantages that no collision of access operation of the n threads is guaranteed, the problem of blocking in cross-thread communication is solved, the resource consumption is reduced, the resources of the system are fully utilized, and the processing speed is improved, so that the throughput of a server is increased.

Description

technical field [0001] The present invention relates to the technical field of computer communication, in particular to a method and system for inter-thread communication based on message queues. Background technique [0002] Throughput is the sum of the amount of data transferred over the network during a performance test. For interactive applications, the throughput indicator reflects the pressure on the server. In the capacity planning test, the throughput indicator indicates the system-level load capacity. With the continuous growth of user traffic and the continuous accumulation of enterprise data, the requirements for server throughput are also getting higher and higher. [0003] In order to improve the throughput, the server can adopt the multi-threading technology, that is, the technology mainly solves the problem of executing multiple threads in the processor unit, reduces the idle time of the processor unit, and increases the throughput capacity of the processor u...

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
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/54
Inventor 蔡东赟王东玉
Owner BEIJING QIANXIN TECH
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More