CN103268247A - Method and device for task execution and adjusting the number of reserved threads in thread pool - Google Patents
Method and device for task execution and adjusting the number of reserved threads in thread pool Download PDFInfo
- Publication number
- CN103268247A CN103268247A CN2013102216561A CN201310221656A CN103268247A CN 103268247 A CN103268247 A CN 103268247A CN 2013102216561 A CN2013102216561 A CN 2013102216561A CN 201310221656 A CN201310221656 A CN 201310221656A CN 103268247 A CN103268247 A CN 103268247A
- Authority
- CN
- China
- Prior art keywords
- reserved
- threads
- thread pool
- task
- frequency
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
- Telephonic Communication Services (AREA)
Abstract
Description
技术领域technical field
本发明涉及计算机技术领域,尤其涉及一种基于调整线程池中保留线程的数量的任务执行技术。The invention relates to the field of computer technology, in particular to a task execution technology based on adjusting the number of reserved threads in a thread pool.
背景技术Background technique
目前服务器、交换机、移动通讯终端等设备的操作系统或应用程序等软件常常需要在单位时间内处理数目巨大的任务请求,但单个任务处理时间却相对较短。传统多线程方案,采用“即时创建,即时销毁”的策略:一旦接受到任务之后,立即创建一个新的线程,由该线程执行任务;任务执行完毕后,线程退出。尽管与创建进程相比,创建线程的时间已经大大的缩短,但是如果提交给线程的任务是执行时间较短,而且执行次数极其频繁,那么创建、销毁线程等非任务操作所消耗的系统资源不可忽略,甚至会若干倍于执行任务本身所消耗的系统资源,导致系统资源被大量非任务操作所消耗,不但任务程序响应速度低下,同时影响同一服务器上其它软件的运行。At present, software such as operating systems or application programs of servers, switches, mobile communication terminals and other equipment often need to process a huge number of task requests per unit time, but the processing time of a single task is relatively short. The traditional multi-threading solution adopts the strategy of "instant creation, instant destruction": once a task is received, a new thread is created immediately, and the thread executes the task; after the task is executed, the thread exits. Although compared with creating a process, the time for creating a thread has been greatly shortened, but if the task submitted to the thread has a short execution time and the number of executions is extremely frequent, the system resources consumed by non-task operations such as creating and destroying threads cannot be used. Neglected, it will even be several times the system resources consumed by the execution of the task itself, resulting in the consumption of system resources by a large number of non-task operations, which not only slows down the response speed of the task program, but also affects the operation of other software on the same server.
因此在软件中引入线程池技术,通过重复利用已创建的线程降低线程创建和销毁造成的消耗来降低系统资源消耗;当任务到达时,任务可以不需要等到线程创建就能被执行来提高响应速度。采用线程池技术的软件都一般具备下面几个组成部分:Therefore, the thread pool technology is introduced in the software to reduce the consumption of system resources by reusing the created threads to reduce the consumption caused by thread creation and destruction; when the task arrives, the task can be executed without waiting for the thread creation to improve the response speed . Software using thread pool technology generally has the following components:
线程池管理器:用于创建并管理线程池中的线程和其它功能单元。Thread pool manager: used to create and manage threads and other functional units in the thread pool.
工作线程:线程池中实际执行任务的线程。Worker thread: The thread in the thread pool that actually executes the task.
任务接口:线程池接受任务的功能单元。Task interface: the functional unit that the thread pool accepts tasks.
任务队列:保存待工作线程执行的任务的功能单元,其中,任务是按照先入先出原则排序的。Task queue: a functional unit that stores tasks to be executed by worker threads, where tasks are sorted according to the first-in-first-out principle.
在采用线程池技术的软件启动之后,线程池管理器在线程池中立即预创建一定数量的工作线程作为保留线程,并将其标识为空闲。线程池管理器通过任务接口接受任务后,选择任一个空闲的保留线程,把任务传入此线程中执行。当保留线程都在执行任务时,线程池管理器会把任务存放在任务队列中;当任务队列没有剩余空间时,线程池管理器自动新创建一定数量的工作线程作为扩展线程,用于处理更多的任务。在任务执行完毕后线程也不立即退出,而是继续保持在池中等待下一次的任务。扩展线程在空闲一段时间后,被线程池管理器销毁,回收系统资源;保留线程在空闲一段时间后,被线程池管理器标识为空闲但不销毁。After the software using the thread pool technology is started, the thread pool manager immediately pre-creates a certain number of worker threads in the thread pool as reserved threads, and marks them as idle. After the thread pool manager accepts the task through the task interface, it selects any idle reserved thread, and transfers the task to this thread for execution. When the reserved threads are executing tasks, the thread pool manager will store the tasks in the task queue; when there is no space left in the task queue, the thread pool manager will automatically create a certain number of worker threads as extended threads for processing updates. many tasks. After the task is executed, the thread does not exit immediately, but continues to wait for the next task in the pool. After the extended thread is idle for a period of time, it is destroyed by the thread pool manager to reclaim system resources; after the reserved thread is idle for a period of time, it is marked as idle by the thread pool manager but not destroyed.
现有线程池的技术方案中,保留线程数量一般都是固定的,少数情况下可以手动调整,但需要重启采用线程池技术的软件,都无法自动地调整保留线程的数量。由于任务数量的波动无法预测,当某一时间段内线程池的任务接口接受到大量任务时,保留线程在指定时限内来不及处理这些任务,则线程池管理器需要执行较多的任务队列操作,还需要创建较多数量的扩展线程;当任务数量回落时并保持一段时间,扩展线程空闲,则线程池管理器需要销毁扩展线程,部分保留线程也有可能空闲。In the existing technical solution of thread pool, the number of reserved threads is generally fixed, and can be adjusted manually in a few cases, but the software using thread pool technology needs to be restarted, and the number of reserved threads cannot be automatically adjusted. Due to the unpredictable fluctuation of the number of tasks, when the task interface of the thread pool receives a large number of tasks within a certain period of time, and the reserved thread is too late to process these tasks within the specified time limit, the thread pool manager needs to perform more task queue operations. It is also necessary to create a large number of extended threads; when the number of tasks falls back and remains for a period of time, and the extended threads are idle, the thread pool manager needs to destroy the extended threads, and some reserved threads may also be idle.
综上所述,现有技术的线程池中保留线程数量固定的技术方案,在任务数量多时,会增加非任务操作对系统资源的消耗,降低对任务的响应速度;在任务数量少时,多余的空闲的保留线程会占用较多的系统资源。To sum up, the technical solution of retaining a fixed number of threads in the thread pool of the prior art will increase the consumption of system resources by non-task operations and reduce the response speed to tasks when the number of tasks is large; when the number of tasks is small, redundant Idle reserved threads consume more system resources.
发明内容Contents of the invention
本发明的实施例提供了一种任务执行及线程池的保留线程的调整方法和装置,用以应对数量变化的任务,以占用或消耗较少的系统资源,保证对任务的响应速度。Embodiments of the present invention provide a method and device for adjusting task execution and reserved threads of a thread pool, which are used to cope with tasks with varying numbers, occupy or consume less system resources, and ensure response speed to tasks.
本发明的技术方案提高一种调整线程池中保留线程的数量的方法,包括:The technical solution of the present invention improves a method for adjusting the number of reserved threads in the thread pool, including:
周期性统计周期内非任务操作的频次;并the frequency of non-task operations within a periodic statistical period; and
根据本周期内统计的非任务操作的频次,确定出下个周期的线程池中保留线程的数量;According to the frequency of non-task operations counted in this period, determine the number of reserved threads in the thread pool for the next period;
将确定出的下个周期的线程池中保留线程的数量与当前线程池中保留线程的数量进行比较,根据比较结果调整当前线程池中的保留线程,得到下个周期的数量调整后的保留线程;Compare the determined number of reserved threads in the thread pool for the next cycle with the number of reserved threads in the current thread pool, adjust the reserved threads in the current thread pool according to the comparison result, and obtain the adjusted reserved threads for the next cycle ;
较佳地,所述非任务操作包括:扩展线程操作;其中,所述扩展线程操作具体包括:创建扩展线程和销毁扩展线程的操作。Preferably, the non-task operations include: extended thread operations; wherein, the extended thread operations specifically include: operations of creating an extended thread and destroying an extended thread.
较佳地,所述非任务操作还包括:任务队列操作;其中,所述任务队列操作具体为将任务存放到任务队列中的操作。Preferably, the non-task operation further includes: a task queue operation; wherein, the task queue operation is specifically an operation of storing a task in the task queue.
较佳地,所述周期性统计周期内非任务操作的频次,具体包括:Preferably, the frequency of non-task operations within the periodical statistical period specifically includes:
每个周期开始时,将本周期的非任务操作频次清0;At the beginning of each cycle, the frequency of non-task operations in this cycle is cleared to 0;
在本周期内,对当前线程池执行数量变化的任务过程中的非任务操作频次进行统计。During this period, count the frequency of non-task operations in the process of tasks whose execution quantity changes in the current thread pool.
较佳地,所述根据本周期内统计的非任务操作频次,确定出下个周期的线程池中保留线程的数量,具体包括:Preferably, the number of reserved threads in the thread pool of the next cycle is determined according to the frequency of non-task operations counted in this cycle, specifically including:
将所述本周期内统计的非任务操作频次与若干个频次阈值进行比较:Compare the frequency of non-task operations counted in the current period with several frequency thresholds:
若存在小于所述非任务操作频次的频次阈值,则确定出小于所述非任务操作频次的各频次阈值中最大的频次阈值,将该最大的频次阈值对应的保留线程建议数量作为下个周期的线程池中保留线程的数量;If there is a frequency threshold less than the frequency of the non-task operation, then determine the maximum frequency threshold less than the frequency thresholds of the non-task operation frequency, and use the suggested number of reserved threads corresponding to the maximum frequency threshold as the next cycle The number of threads reserved in the thread pool;
否则,将本周期的非空闲的保留线程数量作为下个周期的线程池中保留线程的数量;Otherwise, use the number of non-idle reserved threads in this cycle as the number of reserved threads in the thread pool for the next cycle;
或者,所述根据本周期内统计的非任务操作频次,确定出下个周期的线程池中保留线程的数量,具体包括:Alternatively, the number of reserved threads in the thread pool of the next cycle is determined according to the frequency of non-task operations counted in this period, specifically including:
将所述本周期分解成n个子周期,n为自然数,所述本周期内统计的非任务操作频次分解成n个子周期内分别统计的n个非任务操作子频次;将n个所述非任务操作子频次分别与若干个频次阈值进行比较:The current cycle is decomposed into n sub-cycles, n is a natural number, and the non-task operation frequency counted in the current cycle is decomposed into n non-task operation sub-frequency statistics respectively in n sub-cycles; The operator sub-frequency is compared with several frequency thresholds respectively:
若存在小于n个所述非任务操作子频次的频次阈值,则确定出小于n个所述非任务操作子频次的各频次阈值中最大的频次阈值,将该最大的频次阈值对应的保留线程建议数量作为下个周期的线程池中保留线程的数量;If there are frequency thresholds less than n sub-frequency of the non-task operation, determine the maximum frequency threshold in each frequency threshold less than n sub-frequency of the non-task operation, and suggest the reserved thread corresponding to the maximum frequency threshold The number is used as the number of reserved threads in the thread pool for the next cycle;
否则,将本周期的非空闲的保留线程数量作为下个周期的线程池中保留线程的数量;Otherwise, use the number of non-idle reserved threads in this cycle as the number of reserved threads in the thread pool for the next cycle;
其中,所述各频次阈值及其对应的保留线程建议数量为预先设定的自然数。Wherein, each of the frequency thresholds and the corresponding recommended number of reserved threads are preset natural numbers.
较佳地,所述将确定出的下个周期的线程池中保留线程的数量与当前线程池中保留线程的数量进行比较,根据比较结果调整当前线程池中的保留线程,得到下个周期的数量调整后的保留线程,具体包括:Preferably, the number of reserved threads in the determined next cycle thread pool is compared with the number of reserved threads in the current thread pool, and the reserved threads in the current thread pool are adjusted according to the comparison result to obtain the number of reserved threads in the next cycle. Adjusted number of reserved threads, including:
计算所述确定出的下个周期的线程池中保留线程的数量与当前线程池的保留线程数量的差值;Calculate the difference between the determined number of reserved threads in the thread pool of the next cycle and the number of reserved threads in the current thread pool;
若计算出的差值大于0,则在所述线程池中创建与所述差值相应个数的保留线程;若计算出的差值小于0,则将所述线程池中与所述差值相应个数的保留线程销毁。If the calculated difference is greater than 0, then create a number of reserved threads corresponding to the difference in the thread pool; The corresponding number of reserved threads are destroyed.
本发明的技术方案还提供一种任务执行方法,包括:The technical solution of the present invention also provides a task execution method, including:
线程池管理器接受到任务后,判断当前线程池中是否有空闲的保留线程;After receiving the task, the thread pool manager judges whether there are idle reserved threads in the current thread pool;
若有,则将该任务分配给其中一个空闲的保留线程执行;否则:If so, assign the task to one of the idle reserved threads for execution; otherwise:
所述线程池管理器判断当前线程池的任务队列是否有剩余空间;若有剩余空间,则所述线程池管理器将任务存放到任务队列中;若没有剩余空间,则所述线程池管理器在所述线程池中创建设定数量的扩展线程,并把任务队列中的待执行任务分配给所述扩展线程执行;The thread pool manager judges whether the task queue of the current thread pool has remaining space; if there is remaining space, the thread pool manager stores the task in the task queue; if there is no remaining space, the thread pool manager Create a set number of extension threads in the thread pool, and assign tasks to be executed in the task queue to the extension threads for execution;
其中,所述线程池中的保留线程的数量是根据如下方法进行调整的:Wherein, the number of reserved threads in the thread pool is adjusted according to the following method:
周期性统计周期内非任务操作的频次;The frequency of non-task operations in the periodic statistical period;
根据本周期内统计的非任务操作的频次,确定出下个周期的线程池中保留线程的数量;According to the frequency of non-task operations counted in this period, determine the number of reserved threads in the thread pool for the next period;
将确定出的下个周期的线程池中保留线程的数量与当前线程池中保留线程的数量进行比较,根据比较结果调整当前线程池中的保留线程,得到下个周期的数量调整后的保留线程。Compare the determined number of reserved threads in the thread pool for the next cycle with the number of reserved threads in the current thread pool, adjust the reserved threads in the current thread pool according to the comparison result, and obtain the adjusted reserved threads for the next cycle .
本发明的技术方案还提供了一种调整线程池中保留线程的数量的装置,包括:The technical solution of the present invention also provides a device for adjusting the number of reserved threads in the thread pool, including:
非任务操作频次统计单元,用于周期性统计周期内非任务操作的频次;The non-task operation frequency statistics unit is used for the frequency of non-task operations in the periodical statistics cycle;
下周期保留线程数量确定单元,用于根据非任务操作频次统计单元确定出的本周期的非任务操作的频次,确定出下个周期的线程池中保留线程的数量;The number of reserved threads in the next cycle is determined by a unit, which is used to determine the number of reserved threads in the thread pool of the next cycle according to the frequency of non-task operations in this cycle determined by the non-task operation frequency statistics unit;
下周期保留线程调整单元,用于将下周期保留线程数量确定单元确定出的下个周期的线程池中保留线程的数量与当前线程池中保留线程的数量进行比较,根据比较结果调整当前线程池中的保留线程,得到下个周期的数量调整后的保留线程。The next cycle reserved thread adjustment unit is used to compare the number of reserved threads in the thread pool of the next cycle determined by the next cycle reserved thread quantity determination unit with the number of reserved threads in the current thread pool, and adjust the current thread pool according to the comparison result The reserved threads in get the number-adjusted reserved threads for the next cycle.
本发明的技术方案还提供了一种任务执行的装置,包括:The technical solution of the present invention also provides a device for task execution, including:
任务管理模块,用于接受到任务后,判断当前线程池中是否有空闲的保留线程;若有,则把该任务分配给其中一个空闲的保留线程执行;否则:The task management module is used to judge whether there are idle reserved threads in the current thread pool after receiving the task; if so, assign the task to one of the idle reserved threads for execution; otherwise:
判断当前线程池的任务队列是否有剩余空间;若有所述剩余空间,则将任务存放到任务队列中;若没有所述剩余空间,则在所述线程池中创建设定数量的扩展线程,并把任务队列中的待执行任务分别分配给所述扩展线程执行;Determine whether the task queue of the current thread pool has remaining space; if there is the remaining space, then store the task in the task queue; if there is no remaining space, create a set number of extended threads in the thread pool, and assigning the tasks to be executed in the task queue to the extended threads for execution;
保留线程调整模块,用于周期性统计周期内非任务操作的频次;根据本周期内统计的非任务操作的频次,确定出下个周期的线程池中保留线程的数量;将确定出的下个周期的线程池中保留线程的数量与当前线程池中保留线程的数量进行比较,根据比较结果调整当前线程池中的保留线程,得到下个周期的数量调整后的保留线程。The reserved thread adjustment module is used for periodically counting the frequency of non-task operations in the period; according to the frequency of non-task operations counted in this period, determine the number of reserved threads in the thread pool of the next cycle; the determined next The number of reserved threads in the periodic thread pool is compared with the number of reserved threads in the current thread pool, and the reserved threads in the current thread pool are adjusted according to the comparison result to obtain the adjusted reserved threads in the next cycle.
较佳地,所述保留线程调整模块具体包括:Preferably, the reserved thread adjustment module specifically includes:
非任务操作频次统计单元,用于周期性统计周期内非任务操作的频次;The non-task operation frequency statistics unit is used for the frequency of non-task operations in the periodical statistics cycle;
下周期保留线程数量确定单元,用于根据非任务操作频次统计单元确定出的本周期的非任务操作的频次,依据设定规则,确定出下个周期的线程池中保留线程的数量。The unit for determining the number of reserved threads in the next cycle is used to determine the number of reserved threads in the thread pool of the next cycle according to the frequency of non-task operations in the current cycle determined by the non-task operation frequency statistics unit and according to the set rules.
下周期保留线程调整单元,用于将下周期保留线程数量确定单元确定出的下个周期的线程池中保留线程的数量与当前线程池中保留线程的数量进行比较,根据比较结果调整当前线程池中的保留线程,得到下个周期的数量调整后的保留线程。The next cycle reserved thread adjustment unit is used to compare the number of reserved threads in the thread pool of the next cycle determined by the next cycle reserved thread quantity determination unit with the number of reserved threads in the current thread pool, and adjust the current thread pool according to the comparison result The reserved threads in get the number-adjusted reserved threads for the next cycle.
本发明方案的方法和装置实现了在执行任务过程中自动调整线程池的保留线程,和利用自动调整线程池的保留线程来执行数量变化的任务,降低线程池工作过程中非任务操作的系统资源消耗,保证对任务的响应速度,还减小占用的系统资源。The method and device of the scheme of the present invention realize the automatic adjustment of the reserved threads of the thread pool in the process of executing tasks, and use the automatically adjusted reserved threads of the thread pool to execute tasks with variable numbers, reducing the system resources of non-task operations in the thread pool working process Consumption, to ensure the response speed of the task, but also reduce the occupied system resources.
附图说明Description of drawings
图1为本发明实施例的调整线程池中保留线程的数量的方法的流程图;Fig. 1 is a flowchart of a method for adjusting the number of reserved threads in a thread pool according to an embodiment of the present invention;
图2a为本发明实施例的周期内任务数量波动图;FIG. 2a is a fluctuation diagram of the number of tasks within a cycle according to an embodiment of the present invention;
图2b为本发明实施例的调整线程池中保留线程的数量的装置的内部结构框图;Figure 2b is a block diagram of the internal structure of the device for adjusting the number of reserved threads in the thread pool according to an embodiment of the present invention;
图3为本发明实施例的利用周期性调整线程池中保留线程的数量来执行任务的方法的流程图;3 is a flowchart of a method for performing tasks by periodically adjusting the number of reserved threads in a thread pool according to an embodiment of the present invention;
图4为本发明实施例的利用周期性调整线程池中保留线程的数量来执行任务的装置的内部结构框图。FIG. 4 is a block diagram of an internal structure of an apparatus for performing tasks by periodically adjusting the number of reserved threads in a thread pool according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案及优点更加清楚明白,以下参照附图并举出优选实施例,对本发明进一步详细说明。然而,需要说明的是,说明书中列出的许多细节仅仅是为了使读者对本发明的一个或多个方面有一个透彻的理解,即便没有这些特定的细节也可以实现本发明的这些方面。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be described in further detail below with reference to the accompanying drawings and preferred embodiments. However, it should be noted that many of the details listed in the specification are only for readers to have a thorough understanding of one or more aspects of the present invention, and these aspects of the present invention can be implemented even without these specific details.
本申请使用的“模块”、“系统”等术语旨在包括与计算机相关的实体,例如但不限于硬件、固件、软硬件组合、软件或者执行中的软件。例如,模块可以是,但并不仅限于:处理器上运行的进程、处理器、对象、可执行程序、执行的线程、程序和/或计算机。举例来说,计算设备上运行的应用程序和此计算设备都可以是模块。一个或多个模块可以位于执行中的一个进程和/或线程内,一个模块也可以位于一台计算机上和/或分布于两台或更多台计算机之间。As used herein, terms such as "module" and "system" are intended to include computer-related entities such as, but not limited to, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a module may be, but is not limited to being limited to being, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer. For example, both an application running on a computing device and the computing device could be modules. One or more modules can reside within a process and/or thread of execution and a module can be localized on one computer and/or distributed between two or more computers.
本发明的发明人,考虑到虽然任务数量的变化不可预测,但一段时间内,任务数量发生较大变化会导致线程池工作过程中非任务操作频次发生较大变化,因此,可以在执行任务过程中根据统计到的所述非任务操作频次自动调整线程池的保留线程数量,用以降低线程池的非任务操作的系统资源消耗,提高对任务的响应速度。其中,非任务操作包括任务队列操作和扩展线程操作;任务队列操作包括任务入任务队列的操作,扩展线程操作包括创建扩展线程和销毁扩展线程的操作。The inventors of the present invention consider that although the change in the number of tasks is unpredictable, within a period of time, a large change in the number of tasks will cause a large change in the frequency of non-task operations in the working process of the thread pool. Therefore, in the process of executing tasks automatically adjust the number of reserved threads in the thread pool according to the statistics of the non-task operation frequency, so as to reduce the system resource consumption of the non-task operation of the thread pool and improve the response speed to the task. Among them, non-task operations include task queue operations and extended thread operations; task queue operations include operations of entering tasks into the task queue, and extended thread operations include operations of creating extended threads and destroying extended threads.
另一方面,利用自动调整线程池中保留线程的方法来执行数量变化的任务,降低了线程池的非任务操作的系统资源消耗,提高对任务的响应速度。On the other hand, by using the method of automatically adjusting the reserved threads in the thread pool to execute tasks with varying numbers, the system resource consumption of non-task operations in the thread pool is reduced, and the response speed to tasks is improved.
基于上述的分析,接下来说明本发明的技术方案的两个方面。其中一个方面根据周期性统计周期内非任务操作频次,自动调整线程池的保留线程数量的方法和装置;另一个方面是利用周期性自动调整保留线程的线程池来执行数量变化的任务的方法和装置。其中,所述周期为预先设定的一段时间。下面结合附图详细说明本发明的技术方案。Based on the above analysis, two aspects of the technical solution of the present invention are described next. One of the aspects is a method and device for automatically adjusting the number of reserved threads in the thread pool according to the frequency of non-task operations in the periodical statistical period; another aspect is the method and device for performing tasks with variable numbers by using the thread pool for periodically automatically adjusting the reserved threads. device. Wherein, the period is a preset period of time. The technical scheme of the present invention will be described in detail below in conjunction with the accompanying drawings.
其中,根据周期性统计周期内非任务操作频次,自动调整线程池的保留线程数量的方法的具体流程图如图1所示,具体包括以下步骤:Among them, according to the frequency of non-task operations in the periodic statistical period, the specific flow chart of the method for automatically adjusting the number of reserved threads in the thread pool is shown in Figure 1, and specifically includes the following steps:
S101:初始化线程池。S101: Initialize the thread pool.
具体的,采用线程池技术的软件启动,在当前线程池中创建线程池管理器、任务接口、任务队列和确定数量的保留线程,并设定该线程池的任务队列长度。例如,创建的保留线程数量为2,设定任务队列长度为50。Specifically, the software using the thread pool technology is started, a thread pool manager, a task interface, a task queue, and a certain number of reserved threads are created in the current thread pool, and the length of the task queue of the thread pool is set. For example, the number of reserved threads created is 2, and the task queue length is set to 50.
同时,线程池管理器开始监控和统计非任务操作频次,直到保留线程数量为0。At the same time, the thread pool manager starts to monitor and count the frequency of non-task operations until the number of reserved threads is 0.
S102:线程池管理器周期性统计周期内非任务操作的频次。S102: The thread pool manager periodically counts the frequency of non-task operations within a period.
具体的,每个周期开始时,将本周期的非任务操作频次清0;在每个周期内,线程池管理器将任务接口接受的任务首先分配给空闲的保留线程执行,当任务数量从小变大时,空闲的保留线程逐渐减少,当空闲的保留线程数量为0时,线程池管理器将待执行的任务依次加入任务队列(即任务队列操作);当任务队列满后,线程池管理器执行创建扩展线程操作;当任务数量从大变小时,所述扩展线程空闲,线程池管理执行销毁扩展线程操作;当任务数量保持相对稳定时,非任务操作很少;线程池管理器对所述非任务操作频次进行统计。Specifically, at the beginning of each cycle, the frequency of non-task operations in this cycle is cleared to 0; in each cycle, the thread pool manager first assigns the tasks accepted by the task interface to idle reserved threads for execution. When the number of idle reserved threads is large, the number of idle reserved threads will gradually decrease. When the number of idle reserved threads is 0, the thread pool manager will add the tasks to be executed to the task queue in turn (that is, task queue operation); when the task queue is full, the thread pool manager will Execute the operation of creating an extended thread; when the number of tasks changes from large to small, the extended thread is idle, and the thread pool management executes the operation of destroying the extended thread; when the number of tasks remains relatively stable, there are few non-task operations; The frequency of non-task operations is counted.
例如,在一个周期内,任务数量波动如图2a所示,横坐标为时间,从左到右等间隔增加,纵坐标为任务数量,从下到上,等间隔增加;任务数量从初始相对平稳在10,迅速波动变大相对平稳在120,之后又波动变小相对稳定在40,该周期内统计的所述非任务操作频次为8。For example, within a cycle, the number of tasks fluctuates as shown in Figure 2a. The abscissa is time, increasing at equal intervals from left to right, and the ordinate is the number of tasks, increasing at equal intervals from bottom to top; the number of tasks is relatively stable from the initial At 10, the rapid fluctuation becomes larger and relatively stable at 120, and then the fluctuation becomes smaller and relatively stable at 40, and the non-task operation frequency counted in this period is 8.
S103:根据本周期统计的非任务操作频次,确定出下个周期的线程池中保留线程的数量。S103: Determine the number of reserved threads in the thread pool in the next cycle according to the frequency of non-task operations counted in this cycle.
具体的,如何确定下个周期的线程池中保留线程的数量可以采用如下的方法:例如,将步骤S102确定的本周期的非任务操作频次与若干个频次阈值进行比较:若存在小于所述非任务操作频次的频次阈值,则确定出小于所述非任务操作频次的各频次阈值中最大的频次阈值,将该最大的频次阈值对应的保留线程建议数量作为下个周期的线程池中保留线程的数量;否则,将本周期的非空闲的保留线程数量作为下个周期的线程池中保留线程的数量。Specifically, how to determine the number of reserved threads in the thread pool of the next cycle can adopt the following method: For example, compare the frequency of non-task operations in this cycle determined in step S102 with several frequency thresholds: The frequency threshold of the task operation frequency is determined to be less than the maximum frequency threshold among the frequency thresholds of the non-task operation frequency, and the number of reserved threads corresponding to the maximum frequency threshold is used as the number of reserved threads in the thread pool of the next cycle. number; otherwise, use the number of non-idle reserved threads in this cycle as the number of reserved threads in the thread pool for the next cycle.
或者,将本周期分解成n个子周期,n为自然数,所述本周期的非任务操作频次分解成n个子周期内分别统计的n个非任务操作子频次;将n个所述非任务操作子频次分别与若干个频次阈值进行比较:若存在小于n个所述非任务操作子频次的频次阈值,则确定出小于n个所述非任务操作子频次的各频次阈值中最大的频次阈值,将该最大的频次阈值对应的保留线程建议数量作为下个周期的线程池中保留线程的数量;否则,将本周期的非空闲的保留线程数量作为下个周期的线程池中保留线程的数量。Or, this cycle is decomposed into n sub-cycles, n is a natural number, and the non-task operation frequency of the current cycle is decomposed into n non-task operation sub-frequency statistics respectively in n sub-cycles; The frequency is compared with several frequency thresholds respectively: if there are frequency thresholds less than n said non-task operation sub-frequency, then determine the maximum frequency threshold in each frequency threshold less than n said non-task operation sub-frequency, and set The recommended number of reserved threads corresponding to the maximum frequency threshold is used as the number of reserved threads in the thread pool of the next cycle; otherwise, the number of non-idle reserved threads in this cycle is used as the number of reserved threads in the thread pool of the next cycle.
其中,所述各频次阈值及其对应的保留线程建议数量为预先设定的自然数。Wherein, each of the frequency thresholds and the corresponding recommended number of reserved threads are preset natural numbers.
S104:将确定出的下个周期的线程池中保留线程的数量与当前线程池中保留线程的数量进行比较,根据比较结果调整当前线程池中的保留线程,得到下个周期的数量调整后的保留线程。S104: Compare the determined number of reserved threads in the thread pool of the next cycle with the number of reserved threads in the current thread pool, adjust the reserved threads in the current thread pool according to the comparison result, and obtain the adjusted number of threads in the next cycle Threads are reserved.
具体的,计算步骤S103确定出的下个周期的线程池中保留线程的数量减去当前线程池的保留线程数量的差值:若计算出的差值大于0,则线程池管理器在当前线程池中创建与所述差值相同个数的保留线程;若计算出的差值等于0,则当前线程池的保留线程不变;若计算出的差值小于0,则线程池管理器销毁当前线程池中与所述差值相同个数的空闲的保留线程;得到下个周期的数量调整后的保留线程。Specifically, the calculation step S103 determines the difference between the number of reserved threads in the thread pool of the next cycle minus the number of reserved threads in the current thread pool: if the calculated difference is greater than 0, then the thread pool manager is in the current thread pool. Create the same number of reserved threads as the difference in the pool; if the calculated difference is equal to 0, the reserved threads of the current thread pool remain unchanged; if the calculated difference is less than 0, the thread pool manager destroys the current The same number of idle reserved threads as the difference value in the thread pool; obtain the adjusted number of reserved threads in the next cycle.
本发明实施例提供一种调整线程池中保留线程的数量的装置,内容结构框图如图2b所示,包括:The embodiment of the present invention provides a device for adjusting the number of reserved threads in the thread pool. The block diagram of the content structure is shown in Figure 2b, including:
非任务操作频次统计单元201,用于周期性统计周期内非任务操作的频次。非任务操作频次统计单元201具体在每个周期开始时,将本周期的非任务操作频次清0;在每个周期内,当当前线程池没有空闲的保留线程时,则统计执行任务队列操作的频次;当任务队列满时,则统计执行创建扩展线程操作的频次;当任务数量从大变小时,则统计执行销毁扩展线程操作的频次;其中,任务队列操作、创建扩展线程操作和销毁扩展线程操作均属于非任务操作。The non-task operation
下周期保留线程数量确定单元202,用于根据非任务操作频次统计单元201确定出的本周期的非任务操作的频次,确定出下个周期的线程池中保留线程的数量。下周期保留线程数量确定单元202具体可以采用如下方法确定出下个周期的线程池中保留线程的数量:例如,将本周期分解成n个子周期,n为自然数,所述本周期的非任务操作频次分解成n个子周期内分别统计的n个非任务操作子频次;将n个非任务操作子频次分别与若干个频次阈值进行比较:若存在小于n个非任务操作子频次的频次阈值,则确定出小于n个非任务操作子频次的各频次阈值中最大的频次阈值,将该最大的频次阈值对应的保留线程建议数量作为下个周期的线程池中保留线程的数量;否则,将本周期的非空闲的保留线程数量作为下个周期的线程池中保留线程的数量。The next cycle reserved thread
其中,所述各频次阈值及其对应的保留线程建议数量为预先设定的自然数。Wherein, each of the frequency thresholds and the corresponding recommended number of reserved threads are preset natural numbers.
下周期保留线程调整单元203,用于计算下周期保留线程数量确定单元202确定出的下个周期的线程池中保留线程的数量减去当前线程池中保留线程的数量的差值,若计算出的差值大于0,则在当前线程池中创建与所述差值相同个数的保留线程;若计算出的差值等于0,则当前线程池的保留线程不变;若计算出的差值小于0,则销毁当前线程池中与所述差值相同个数的空闲的保留线程。The next cycle reserved
此外,利用周期性自动调整保留线程的线程池来执行数量变化的任务的方法的具体流程图如图3所示,具体包括以下步骤:In addition, the specific flow chart of the method for executing tasks with varying numbers by periodically automatically adjusting the thread pool of reserved threads is shown in Figure 3, which specifically includes the following steps:
S301:初始化线程池。S301: Initialize the thread pool.
具体的,采用线程池技术的软件启动,在当前线程池中创建线程池管理器、任务接口、任务队列和确定数量的保留线程,并设定任务队列长度。Specifically, the software using the thread pool technology is started, a thread pool manager, a task interface, a task queue, and a certain number of reserved threads are created in the current thread pool, and the length of the task queue is set.
S302:线程池管理器通过任务接口接受到任务后,判断当前线程池中是否有空闲的保留线程;若有,则执行步骤S303;否则,执行步骤S304。S302: After receiving the task through the task interface, the thread pool manager judges whether there is an idle reserved thread in the current thread pool; if yes, execute step S303; otherwise, execute step S304.
S303:线程池管理器把任务分配给其中一个空闲的保留线程执行。S303: The thread pool manager assigns the task to one of the idle reserved threads for execution.
当任务数量较小且相对稳定时,利用自动调整后的保留线程执行任务,无需任务队列操作和创建扩展线程操作及销毁扩展线程操作,节省了非任务操作所消耗的系统资源,保证对任务的响应速度;也无需冗余的保留线程,减少了系统资源的占用。When the number of tasks is small and relatively stable, the automatically adjusted reserved thread is used to execute the task, and there is no need for task queue operations, creation of extended thread operations, and destruction of extended thread operations, which saves system resources consumed by non-task operations and ensures that tasks are guaranteed. Response speed; there is no need for redundant reserved threads, which reduces the occupation of system resources.
S304:线程池管理器判断任务队列是否有剩余空间;若有所述剩余空间,则执行步骤S305;否则,执行步骤S306。S304: The thread pool manager judges whether there is remaining space in the task queue; if there is remaining space, execute step S305; otherwise, execute step S306.
S305:线程池管理器将任务存放到任务队列中。S305: The thread pool manager stores the tasks in the task queue.
当任务数量从大变小时,利用自动调整后的保留线程执行任务,无需创建和销毁扩展线程操作,只需任务队列操作,节省了非任务操作所消耗的系统资源,保证对任务的响应速度。When the number of tasks changes from large to small, the automatically adjusted reserved thread is used to execute tasks, without creating and destroying extended thread operations, only task queue operations are required, which saves system resources consumed by non-task operations and ensures the response speed to tasks.
S306:线程池管理器在当前线程池中创建设定数量的扩展线程,并把任务队列中的待执行任务分配给扩展线程执行。S306: The thread pool manager creates a set number of extended threads in the current thread pool, and assigns the tasks to be executed in the task queue to the extended threads for execution.
当任务数量从小变大或者任务数量较大且相对稳定时,利用自动调整后的保留线程执行任务,减小创建和销毁扩展线程操作的几率,保证对任务的相应速度。When the number of tasks increases from small to large or the number of tasks is large and relatively stable, use the automatically adjusted reserved thread to execute tasks, reduce the probability of creating and destroying extended thread operations, and ensure the corresponding speed of tasks.
此外,线程池管理器监测扩展线程状态:若监测到扩展线程执行任务完毕,则将该扩展线程标识为空闲,将空闲了一段时间的扩展线程销毁;未销毁的扩展线程继续执行任务,直到扩展线程数量为0,同时保留线程持续执行任务。In addition, the thread pool manager monitors the state of the extended thread: if it detects that the extended thread has completed its task, it will mark the extended thread as idle, and destroy the extended thread that has been idle for a period of time; the undestroyed extended thread continues to perform tasks until the extended thread is extended. The number of threads is 0, and threads are reserved to continue executing tasks.
线程池管理器监测任务队列状态,若任务队列不为空:则判断线程池管理器监测到扩展线程数量是否为0:若扩展线程数量为0,则根据先入先出原则把待执行任务从任务队列分配给保留线程执行;否则,把待执行任务从任务队列分配给扩展线程执行;直到任务队列为空。The thread pool manager monitors the status of the task queue. If the task queue is not empty: then judge whether the thread pool manager detects that the number of extended threads is 0: if the number of extended threads is 0, the task to be executed is removed from the task queue according to the first-in-first-out principle. The queue is allocated to the reserved thread for execution; otherwise, the task to be executed is allocated from the task queue to the extended thread for execution; until the task queue is empty.
线程池管理器监测保留线程状态:若监测到保留线程执行任务完毕,则将该保留线程标识为空闲;即使保留线程空闲了一段时间也不销毁,非空闲的保留线程继续执行任务,直到非空闲的保留线程数量为0。The thread pool manager monitors the state of the reserved thread: if it detects that the reserved thread has completed its task, it will mark the reserved thread as idle; even if the reserved thread is idle for a period of time, it will not be destroyed, and the non-idle reserved thread will continue to perform tasks until it is not idle The number of reserved threads is 0.
此外,本发明实施例还提供了一种利用周期性自动调整保留线程的线程池来执行数量变化的任务的装置,内部结构框图如图4所示,具体包括:任务管理模块401和保留线程调整模块402;In addition, the embodiment of the present invention also provides a device for executing tasks with variable numbers by periodically automatically adjusting the thread pool of reserved threads. The internal structure block diagram is shown in FIG.
所述任务管理模块401,用于接受到任务后,判断当前线程池中是否有空闲的保留线程;若有,则把该任务分配给其中一个空闲的保留线程执行;否则:判断当前线程池的任务队列是否有剩余空间;若有所述剩余空间,则将任务存放到任务队列中;若没有所述剩余空间,则在所述线程池中创建设定数量的扩展线程,并把任务队列中的待执行任务分别分配给所述扩展线程执行;Described
其中,所述线程池中的保留线程的数量是根据保留线程调整模块402调整的:保留线程调整模块402用于周期性统计周期内非任务操作的频次;根据本周期内统计的非任务操作的频次,确定出下个周期的线程池中保留线程的数量;将确定出的下个周期的线程池中保留线程的数量与当前线程池中保留线程的数量进行比较,根据比较结果调整当前线程池中的保留线程,得到下个周期的数量调整后的保留线程。Wherein, the number of reserved threads in the thread pool is adjusted according to the reserved thread adjustment module 402: the reserved
其中,所述保留线程调整模块402,包括:上述的非任务操作频次统计单元201、下周期保留线程数量确定单元202和下周期保留线程调整单元203。Wherein, the reserved
上述的任务管理模块401和保留线程调整模块402均可设置于线程池管理器中,或者,任务管理模块401设置于线程池管理器中,保留线程调整模块402设置于线程池管理器外。Both the
本发明方案的方法和装置实现了在执行任务过程中自动调整线程池的保留线程,和利用自动调整线程池的保留线程来执行数量变化的任务,降低线程池工作过程中非任务操作的系统资源消耗,保证对任务的响应速度,还减小占用的系统资源。The method and device of the scheme of the present invention realize the automatic adjustment of the reserved threads of the thread pool in the process of executing tasks, and use the automatically adjusted reserved threads of the thread pool to execute tasks with variable numbers, reducing the system resources of non-task operations in the thread pool working process Consumption, to ensure the response speed of the task, but also reduce the occupied system resources.
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention, it should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications should also be It is regarded as the protection scope of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310221656.1A CN103268247B (en) | 2013-06-05 | 2013-06-05 | Method and device for executing task and adjusting number of remaining threads in thread pool |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310221656.1A CN103268247B (en) | 2013-06-05 | 2013-06-05 | Method and device for executing task and adjusting number of remaining threads in thread pool |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN103268247A true CN103268247A (en) | 2013-08-28 |
| CN103268247B CN103268247B (en) | 2017-01-18 |
Family
ID=49011880
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201310221656.1A Active CN103268247B (en) | 2013-06-05 | 2013-06-05 | Method and device for executing task and adjusting number of remaining threads in thread pool |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN103268247B (en) |
Cited By (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105159768A (en) * | 2015-09-09 | 2015-12-16 | 浪潮集团有限公司 | Task management method and cloud data center management platform |
| CN106325977A (en) * | 2015-06-19 | 2017-01-11 | 北京京东尚科信息技术有限公司 | Method and system for executing task on the basis of thread pool |
| CN107341050A (en) * | 2016-04-28 | 2017-11-10 | 北京京东尚科信息技术有限公司 | Service processing method and device based on dynamic thread pool |
| CN107949017A (en) * | 2018-01-28 | 2018-04-20 | 厦门四信通信科技有限公司 | A kind of method of raising LoRa base station data Packet Forwarding Rates |
| CN108153584A (en) * | 2016-12-02 | 2018-06-12 | 百度在线网络技术(北京)有限公司 | A kind of method and apparatus for being used to determine the Thread Count that destination network device need to distribute |
| CN109271252A (en) * | 2018-08-29 | 2019-01-25 | 华为技术有限公司 | Method and device for adjusting thread number |
| CN111324668A (en) * | 2020-02-18 | 2020-06-23 | 中国联合网络通信集团有限公司 | Database data synchronous processing method and device and storage medium |
| CN113590300A (en) * | 2021-09-29 | 2021-11-02 | 天聚地合(苏州)数据股份有限公司 | Timed task execution method and device, storage medium and equipment |
| CN113722078A (en) * | 2021-11-02 | 2021-11-30 | 西安热工研究院有限公司 | High-concurrency database access method, system and equipment based on thread pool |
| US11340955B2 (en) | 2020-01-02 | 2022-05-24 | International Business Machines Corporation | Thread pool management for multiple applications |
| CN117034125A (en) * | 2023-10-08 | 2023-11-10 | 江苏臻云技术有限公司 | Classification management system and method for big data fusion |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5991792A (en) * | 1998-01-02 | 1999-11-23 | International Business Machines Corporation | Method, apparatus and computer program product for dynamically managing a thread pool of reusable threads in a computer system |
| US20050086359A1 (en) * | 2003-10-16 | 2005-04-21 | International Business Machines Corporation | Monitoring thread usage to dynamically control a thread pool |
| US20080313637A1 (en) * | 2007-06-13 | 2008-12-18 | Hee Yong Youn | Prediction-based dynamic thread pool management method and agent platform using the same |
| CN101739293A (en) * | 2009-12-24 | 2010-06-16 | 航天恒星科技有限公司 | Method for scheduling satellite data product production tasks in parallel based on multithread |
| CN102591721A (en) * | 2011-12-30 | 2012-07-18 | 北京新媒传信科技有限公司 | Method and system for distributing thread execution task |
-
2013
- 2013-06-05 CN CN201310221656.1A patent/CN103268247B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5991792A (en) * | 1998-01-02 | 1999-11-23 | International Business Machines Corporation | Method, apparatus and computer program product for dynamically managing a thread pool of reusable threads in a computer system |
| US20050086359A1 (en) * | 2003-10-16 | 2005-04-21 | International Business Machines Corporation | Monitoring thread usage to dynamically control a thread pool |
| US20080313637A1 (en) * | 2007-06-13 | 2008-12-18 | Hee Yong Youn | Prediction-based dynamic thread pool management method and agent platform using the same |
| CN101739293A (en) * | 2009-12-24 | 2010-06-16 | 航天恒星科技有限公司 | Method for scheduling satellite data product production tasks in parallel based on multithread |
| CN102591721A (en) * | 2011-12-30 | 2012-07-18 | 北京新媒传信科技有限公司 | Method and system for distributing thread execution task |
Non-Patent Citations (1)
| Title |
|---|
| 张复兴,等: ""扩展线程池模型及性能分析"", 《计算技术与自动化》, vol. 26, no. 4, 31 December 2007 (2007-12-31), pages 110 - 112 * |
Cited By (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106325977A (en) * | 2015-06-19 | 2017-01-11 | 北京京东尚科信息技术有限公司 | Method and system for executing task on the basis of thread pool |
| CN106325977B (en) * | 2015-06-19 | 2020-05-01 | 北京京东尚科信息技术有限公司 | Method and system for executing tasks based on thread pool |
| CN105159768A (en) * | 2015-09-09 | 2015-12-16 | 浪潮集团有限公司 | Task management method and cloud data center management platform |
| CN107341050A (en) * | 2016-04-28 | 2017-11-10 | 北京京东尚科信息技术有限公司 | Service processing method and device based on dynamic thread pool |
| CN108153584B (en) * | 2016-12-02 | 2021-11-09 | 百度在线网络技术(北京)有限公司 | Method and equipment for determining number of threads to be allocated to target network equipment |
| CN108153584A (en) * | 2016-12-02 | 2018-06-12 | 百度在线网络技术(北京)有限公司 | A kind of method and apparatus for being used to determine the Thread Count that destination network device need to distribute |
| CN107949017A (en) * | 2018-01-28 | 2018-04-20 | 厦门四信通信科技有限公司 | A kind of method of raising LoRa base station data Packet Forwarding Rates |
| CN109271252A (en) * | 2018-08-29 | 2019-01-25 | 华为技术有限公司 | Method and device for adjusting thread number |
| US11340955B2 (en) | 2020-01-02 | 2022-05-24 | International Business Machines Corporation | Thread pool management for multiple applications |
| CN111324668A (en) * | 2020-02-18 | 2020-06-23 | 中国联合网络通信集团有限公司 | Database data synchronous processing method and device and storage medium |
| CN111324668B (en) * | 2020-02-18 | 2023-11-21 | 中国联合网络通信集团有限公司 | Database data synchronous processing method, device and storage medium |
| CN113590300A (en) * | 2021-09-29 | 2021-11-02 | 天聚地合(苏州)数据股份有限公司 | Timed task execution method and device, storage medium and equipment |
| CN113590300B (en) * | 2021-09-29 | 2022-03-25 | 天聚地合(苏州)数据股份有限公司 | Timed task execution method and device, storage medium and equipment |
| CN113722078A (en) * | 2021-11-02 | 2021-11-30 | 西安热工研究院有限公司 | High-concurrency database access method, system and equipment based on thread pool |
| CN117034125A (en) * | 2023-10-08 | 2023-11-10 | 江苏臻云技术有限公司 | Classification management system and method for big data fusion |
| CN117034125B (en) * | 2023-10-08 | 2024-01-16 | 江苏臻云技术有限公司 | Classification management system and method for big data fusion |
Also Published As
| Publication number | Publication date |
|---|---|
| CN103268247B (en) | 2017-01-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103268247B (en) | Method and device for executing task and adjusting number of remaining threads in thread pool | |
| CN101473307B (en) | Method, system, and apparatus for scheduling computer micro-jobs to execute at non-disruptive times | |
| US9928245B2 (en) | Method and apparatus for managing memory space | |
| CN111625331B (en) | Task scheduling method, device, platform, server and storage medium | |
| CN106557369B (en) | Multithreading management method and system | |
| CN102096603B (en) | Task decomposition control method in MapReduce system and scheduling node equipment | |
| CN103036946B (en) | A kind of method and system processing file backup task for cloud platform | |
| US9875145B2 (en) | Load based dynamic resource sets | |
| CN106874100B (en) | Computing resource allocation method and device | |
| US20140344597A1 (en) | Dynamic load and priority based clock scaling for non-volatile storage devices | |
| US20200334065A1 (en) | A method, apparatus and system for real-time virtual network function orchestration | |
| CN103677999A (en) | Management of resources within a computing environment | |
| CN111258746A (en) | Resource allocation method and service equipment | |
| US12180475B2 (en) | Oversubscription scheduling | |
| CN105955809B (en) | Thread scheduling method and system | |
| CN106598740A (en) | System and method for limiting CPU (Central Processing Unit) occupancy rate of multi-thread program | |
| CN101408853A (en) | Apparatus and method for scheduling virtual machine | |
| CN115080209A (en) | System resource scheduling method, device, electronic device and storage medium | |
| JP6189545B2 (en) | Network application parallel scheduling to reduce power consumption | |
| CN103729417B (en) | A kind of method and device of data scanning | |
| Huh et al. | Cross‐layer resource control and scheduling for improving interactivity in Android | |
| US20200142736A1 (en) | Computer processing system with resource optimization and associated methods | |
| CN118747112A (en) | A multi-threaded data processing method, device, equipment and storage medium | |
| KR20150089665A (en) | Appratus for workflow job scheduling | |
| WO2024230309A1 (en) | Processor scheduling method and apparatus, computer device, computer-readable storage medium, and computer program product |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant |