Multithread management method and device

A management method and technology for a management device, applied in the field of multi-thread management methods and devices, can solve problems such as wasting system resources, and achieve the effects of maintaining load balance, improving concurrency, and avoiding contention

Active Publication Date: 2014-02-26
BEIJING QIHOO TECH CO LTD
View PDF5 Cites 49 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Since most of the worker threads will go through the process of sleeping, being woken up, and then going to sleep, a large amount of system resources will be wasted when the main thread assigns tasks to the worker threads in the prior art.

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
  • Multithread management method and device
  • Multithread management method and device
  • Multithread management method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0025] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0026] like figure 1 As shown, it is a threading model in a multithreaded application program in the prior art, and the multithreaded application program includes a main thread and three worker threads (such as worker thread 1, worker thread 2 and worker thread 3), and there is a File descriptor fd (file descriptor), the main thread can use this file descriptor fd to assign processing tasks to worker threads, and all worker threads...

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 multithread management method and device applicable to a framework where an operation system controls a plurality of threads. The plurality of threads comprise a main thread and a plurality of working threads. The method includes that relevant information of a client is packaged into a processing task after the main thread receives a connection request from the client; the main thread selects a working thread from the plurality of working threads according to a preset working thread selection strategy; the main thread writes the processing task obtained through packaging into a task queue of the selected working thread; the main thread activates the selected working thread, the selected working thread takes the processing task from the task queue and the selected working thread conducts corresponding processing according to the processing task. By means of the method and device, system resource waste caused in the process that the main thread distributes tasks for the working threads is avoided.

Description

technical field [0001] The invention belongs to the technical field of computers, and in particular relates to a multi-thread management method and device. Background technique [0002] In order to give full play to the performance of multi-core CPU (central processing unit), many softwares use multi-process or multi-thread mode in their architecture. Compared with multi-process, multi-threading has natural advantages in sharing resources because all threads are in the same address space. Advantages, so most software uses multi-threaded mode. In multi-threaded mode, there are often main threads and worker threads. There is only one main thread, which is used to receive connections from clients, and then assign tasks to be processed to worker threads. There will be multiple worker threads that receive messages from the main thread. Task allocation commands to specifically handle client requests. [0003] However, in the prior art, when the main thread assigns tasks to the w...

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/48G06F9/50
Inventor 朱超陈飞王超
Owner BEIJING QIHOO 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