Method and system for solving multi-thread problem caused by CPU optimization

A multi-threading and problem-solving technology, applied in the field of Internet application development, can solve problems such as abnormal multi-threading results, and achieve the effects of ensuring cross-platform portability, saving program development time, and strong versatility

Inactive Publication Date: 2019-10-25
WUHAN DOUYU NETWORK TECH CO LTD
View PDF1 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] In view of the defects in the prior art, the purpose of the present invention is to provide a method for solving the multi-thread problem caused by CPU optimization, which can effectively solve the problem of abnormal results caused by multi-thread caused by CPU optimization, and is safer and more reliable

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 solving multi-thread problem caused by CPU optimization
  • Method and system for solving multi-thread problem caused by CPU optimization
  • Method and system for solving multi-thread problem caused by CPU optimization

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0025] The present invention will be described in further detail below in conjunction with the accompanying drawings and embodiments.

[0026] see figure 1 As shown, the embodiment of the present invention provides a method for solving the multithreading problem caused by CPU optimization, including steps:

[0027] S1: setting a memory barrier in the program code, the memory barrier is used to sequentially execute all program codes before the memory barrier during CPU optimization to prevent code rearrangement;

[0028] S2: Perform CPU optimization on the program code.

[0029] By setting memory barriers and avoiding instruction rearrangement, it can effectively solve the problem of abnormal results caused by multi-threading caused by CPU optimization, which is safer and more reliable.

[0030] Among them, the memory barrier, also known as memory barrier, memory barrier or barrier instruction, is a kind of synchronization barrier instruction, which is a synchronization point...

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 method for solving a multi-thread problem caused by CPU optimization. The method relates to the field of internet application development, and comprises the following steps:setting a memory gate barrier in a program code, and then optimizing a CPU (Central Processing Unit), the memory gate barrier being used for sequentially executing all program codes before the memorygate barrier during CPU optimization to prevent code rearrangement. According to the method for solving the multi-thread problem caused by CPU optimization, the problem of result abnormity caused by multiple threads caused by CPU optimization can be effectively solved, and the method is safer and more reliable.

Description

technical field [0001] The invention relates to the field of Internet application development, in particular to a method and system for solving the multi-thread problem caused by CPU optimization. Background technique [0002] Usually a compiler is a program that translates "one language" into "another language". When writing program code in C++ language, it is usually necessary to use a C++ compiler to compile the C++ program code and convert it into the final Executable program. Moreover, C++ compilers generally have various compilation options, among which the optimization option is a commonly used compilation option. [0003] There are many compiler optimization options. Common compiler optimizations include: function embedding, useless code deletion, standardized loop structure, loop body unrolling, loop body merging, splitting, array filling, etc. Among them, the optimization of useless code deletion refers to the fact that the C++ compiler believes that some code lo...

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): G06F11/36
CPCG06F11/3624G06F11/3628G06F11/3644
Inventor 杨亮陈少杰张文明
Owner WUHAN DOUYU NETWORK 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