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

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

A message queue and inter-thread technology, applied in the field of inter-thread communication based on message queues, can solve problems such as inability to fully utilize system resources, blockage, and resource consumption

Active Publication Date: 2014-03-12
BEIJING QIANXIN TECH
View PDF4 Cites 7 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 cross-thread communication based on message queue
  • Method and system for cross-thread communication based on message queue
  • Method and system for cross-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 comprehensible, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0150] In order to enable 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 a 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. However, it can interact with other resources belonging to the same process Threads share all resources owned by the process.

[0152] Running multiple thre...

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 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 refers to the sum of the amount of data transmitted on the network during a performance test. For interactive applications, the throughput index reflects the pressure on the server. In the test of capacity planning, the throughput index shows the load capacity at the system level. With the continuous growth of user traffic and the continuous accumulation of enterprise data, the throughput requirements for servers are also getting higher and higher. [0003] In order to improve the throughput, the server can adopt multi-threading technology, which 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 unit. When solving the pro...

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 Applications(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