Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Multi-thread log output method and device

A multi-threading and log technology, applied in the direction of multi-program device, program synchronization, inter-program communication, etc., can solve the problems of system performance degradation, difficulty in detecting the running status of each thread, and inability to display the calling sequence of each thread, etc. To achieve the effect of avoiding system performance degradation

Inactive Publication Date: 2018-06-26
ZHENGZHOU YUNHAI INFORMATION TECH CO LTD
View PDF7 Cites 9 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] However, this method of locking protection has disadvantages: it is impossible to display the calling sequence of each thread, which makes it difficult for developers to detect the running status of each thread in the software
At the same time, the competition of mutexes will lead to the reduction of system performance.

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
  • Multi-thread log output method and device
  • Multi-thread log output method and device
  • Multi-thread log output method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0041] The core of the present application is to provide a method, device, device and computer-readable storage medium for multi-thread log output, and the method can display the call sequence of each thread.

[0042] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments It is a part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

[0043] Please refer to figure 1 , figure 1 It is a flow chart of a method for multi-threaded log output provided by the embodiment of this a...

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 multi-thread log output method. The method comprises the steps that a log sequence number counting program is called to set log sequence numbers for all logs according to thesequential order of log generation time of all service threads; all the logs are cached into log cache regions corresponding to the service threads; when a log output command input by a user is received, a log output thread is utilized to traverse all the log cache regions to find logs corresponding to the log output command; and the logs corresponding to the log output command are output according to the order of the log sequence numbers. According to the method, by presetting the log cache regions, isolation of output logs is realized; by calling the log sequence number counting program toset the log sequence numbers for all the logs, it is convenient to review the calling order of all the service threads; and by utilizing the log output thread to perform asynchronous order-placing output on the logs, the influence of log output on a system is lowered to the minimum. The invention meanwhile provides a multi-thread log output device, equipment and a computer readable storage medium.The multi-thread log output device, the equipment and the computer readable storage medium also have the advantages.

Description

technical field [0001] The present application relates to the field of software development, and in particular to a method, device, device and computer-readable storage medium for outputting multithreaded logs. Background technique [0002] In software development, it is a common method for developers to realize multi-threaded concurrent operation, and the log system is a necessary means to detect the running status of the software. The main design idea of ​​the multi-threaded daily arrival system is that through a shared queue, multiple input terminals can simultaneously add record information to the queue in a non-blocking manner, and the output terminal can automatically and timely output the record information in the queue to the console or It is stored in files and databases. In order to ensure the consistency of multi-threaded output logs, a common method is to lock and protect the modification of the shared queue to prevent multiple threads from modifying the queue a...

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/52G06F9/54
CPCG06F9/52G06F9/544
Inventor 李庆龙
Owner ZHENGZHOU YUNHAI INFORMATION TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products