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

Method for designing thread pool capable of ensuring temporal succession

A design method and thread pool technology, applied in multi-programming devices, resource allocation, etc., can solve problems such as inversion of data time continuity, and achieve the best concurrency performance and completely consistent time continuity

Inactive Publication Date: 2011-07-13
HUAZHONG UNIV OF SCI & TECH
View PDF0 Cites 25 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

For example, in a real-time database, there is a requirement for time continuity for all data, but since all tasks are executed in parallel in the thread pool, the task that arrives later may be completed before the previous task, so that the data output by the thread pool is consistent with the input The data for is reversed in time continuity

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 for designing thread pool capable of ensuring temporal succession
  • Method for designing thread pool capable of ensuring temporal succession
  • Method for designing thread pool capable of ensuring temporal succession

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0052] Such as figure 1 It can be seen that for a task arriving at the thread pool, the task distribution module first searches the mapping table for the thread ID that the task needs to deliver according to the task ID, and then sends the task to the task queue of the corresponding thread. Request a new task execution in the task queue, and then output the result.

[0053] figure 2 It is the process of adding new tasks to the thread pool. The specific steps are as follows:

[0054] Step 201, using the load value calculation formula to calculate the load value of the task according to the frequency of the newly added task.

[0055] Step 202, using sequential traversal to find out one of the threads with the smallest load value among all the threads.

[0056] Step 203, add the load value to the minimum load thread found in 202.

[0057] Step 204, using the variance calculation formula to calculate the load variance of all threads in the thread pool.

[0058] Step 205, judgi...

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 relates to a method for designing a thread pool capable of ensuring temporal succession. The method comprises the following steps of: maintaining a task for the thread pool and marking the task into to a Hash mapping table of a thread ID, for managing the task distribution; adding an attribute parameter to thread parameters: a load (LThread) used for identifying the total quantity of the distributed tasks of each thread; and instead of sharing the same task queue by all the threads, configuring a corresponding task queue for each thread in the thread pool, wherein each thread can search for a new task from the corresponding task queue, and a single monitoring thread is arranged. The method provided by the invention has the advantages that: 1) by utilizing the new added function of the mapping table, the temporal successions for inputting and outputting data of each task can be guaranteed to be completely consistent, and 2) the loads on all threads can be guaranteed to be always consistent by the monitoring thread started at regular time, thereby achieving the best concurrent property.

Description

technical field [0001] The invention relates to a thread pool design method, in particular to a thread pool design method for ensuring time continuity. Background technique [0002] A thread pool is a form of multithreading. The thread pool will pre-create several threads to perform application tasks, and these threads are usually organized in the form of queues. Generally, the number of tasks that the thread pool needs to perform is greater than the number of threads in the thread pool. When a thread completes a task, it will request new tasks from the task queue to execute until all tasks in the task queue are completed. After that, the threads in the thread pool will be suspended or dormant until a new task arrives. [0003] Traditional thread pools have different priorities for the tasks executed, and treat tasks with the same priority completely equally. But complete equality does not apply to all application scenarios. For example, in a real-time database, there i...

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/50
Inventor 王非黄本雄卢正新全中伟邓磊
Owner HUAZHONG UNIV OF SCI & TECH
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