CN106095590B - A kind of method for allocating tasks and device based on thread pool - Google Patents

A kind of method for allocating tasks and device based on thread pool Download PDF

Info

Publication number
CN106095590B
CN106095590B CN201610580284.5A CN201610580284A CN106095590B CN 106095590 B CN106095590 B CN 106095590B CN 201610580284 A CN201610580284 A CN 201610580284A CN 106095590 B CN106095590 B CN 106095590B
Authority
CN
China
Prior art keywords
thread
management unit
role management
task
count
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.)
Active
Application number
CN201610580284.5A
Other languages
Chinese (zh)
Other versions
CN106095590A (en
Inventor
赵建霖
王涛
李关乐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Union Mobile Pay Co Ltd
Original Assignee
Union Mobile Pay Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Union Mobile Pay Co Ltd filed Critical Union Mobile Pay Co Ltd
Priority to CN201610580284.5A priority Critical patent/CN106095590B/en
Publication of CN106095590A publication Critical patent/CN106095590A/en
Application granted granted Critical
Publication of CN106095590B publication Critical patent/CN106095590B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5011Pool
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5018Thread allocation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a kind of method for allocating tasks and device based on thread pool, is related to computer application technology, which comprises obtains the corresponding thread distribution request of task;The corresponding thread role management unit of the task is determined according to the task identification in the thread distribution request;According to the quantity for the thread that can be called in thread pool in the thread thread role management unit, thread is called to distribute to the task from thread pool.In the embodiment of the present invention, it is more accurately task distribution thread using thread role management unit, and thread is distributed for task according to the quantity for the thread that can be called in the thread pool in each thread role management unit, thread effectively can be distributed for task, improve the efficiency and accuracy rate of task distribution.

Description

A kind of method for allocating tasks and device based on thread pool
Technical field
The present invention relates to computer application technology more particularly to a kind of method for allocating tasks and dress based on thread pool It sets.
Background technique
In computer related fields, thread pool is a kind of technology that very important multi-thread concurrent executes.Thread Pond is using the technology pre-created, after application program launching, creates the thread of certain amount immediately, is put into idle queues. These threads are at obstruction (hang-up) state, do not consume central processing unit resource, only take up lesser memory headroom.When appoint After business arrives, buffer pool selects an idle thread, and task is passed in this thread and is run.When the thread in thread pool is all being located Reason task, thread pool automatically create a certain number of new threads, for handling more tasks.The thread after task is finished Also it does not exit, but is continually maintained in waiting in thread pool next time for task.
But the permitted concurrent thread of thread pool has the upper limit, if it is more than upper for needing concurrent Thread Count simultaneously Limit, then a part of thread will wait.It is very time-consuming or due to program bug if there is the thread task that is carrying out Equal other reasons, do not discharge timely, all threads in thread pool are caused to be used up, this is all after just will appear Task can not all execute again, lead to the paralysis of entire application program.
In the prior art, after thread pool threads increase to maximum number of threads, subsequent thread needs to handle, generally Be to handle according to following two mode: the first is not execute new task, directly returns to failure;Second is that task dispatching is allowed to wait for, It waits and being executed again when having usable thread in thread pool.
But the prior art is utilized, first method will lead to new task requests and can not all handle, and second method Method be easy to cause the time delay of task;In conclusion the method for allocating tasks performance in the prior art based on thread pool is poor, effect Rate is low.
Summary of the invention
The present invention provides a kind of method for allocating tasks and device based on thread pool, for solving in the prior art be based on The problem of method for allocating tasks performance of thread pool is poor, low efficiency.
The embodiment of the present invention provides a kind of method for allocating tasks based on thread pool, which comprises
The corresponding thread distribution request of acquisition task;
The corresponding thread thread task management list of the task is determined according to the task identification in the thread distribution request Member;
According to the quantity for the thread that can be called in the thread thread role management unit, thread point is called from thread pool Task described in dispensing;
Wherein, the quantity of the thread called is the thread that thread role management unit can be called from thread pool Quantity.
In the embodiment of the present invention, the corresponding thread distribution request of task is obtained, and according in the thread distribution request Task identification determines the corresponding thread role management unit of the task, in the corresponding thread role management unit of the task that determined Afterwards, it is that task distribution thread is handled according to the quantity for the thread that thread pool can call in thread role management unit, utilizes Different thread role management units more accurately can distribute thread for task, and according to each thread role management unit In the quantity of the thread called be that task in the role management unit distributes thread, improve as task distribution Efficiency and accuracy rate.
Further, described that the thread that can be called in the thread thread role management unit is determined according to following manner Quantity:
According to the private that can distribute to the corresponding task of the thread role management unit in the thread role management unit There is number of threads maximum value, the corresponding task of the thread role management unit can be distributed in the thread role management unit And in the shared number of threads maximum value of the corresponding task of other thread role management units, the thread role management unit The count value of the count value of privately owned Thread Count batching counter and the shared Thread Count batching counter, determines the thread thread The quantity for the thread that can be called in role management unit.
In the embodiment of the present invention, according to privately owned number of threads maximum value, the common lines in per thread role management unit Described in the count value of number of passes amount maximum value, the count value of privately owned Thread Count batching counter and shared Thread Count batching counter determines The quantity for the thread that can be called in thread thread role management unit, can effectively count in the thread role management unit is No there are also available threads, preferably distribute thread for the task in the thread role management unit.
Further, the quantity according to the thread that can be called in the thread thread role management unit, from thread Thread is called to distribute to the task in pond, comprising:
Judge whether the count value of the privately owned Thread Count batching counter in the thread role management unit is less than the line The privately owned number of threads maximum value of the corresponding task of the thread role management unit can be distributed in journey role management unit;
If the count value of the privately owned Thread Count batching counter in the thread role management unit is less than the thread task The privately owned number of threads maximum value that the corresponding task of the thread role management unit can be distributed in administrative unit, then in thread Select a thread as the distribution thread of the task in pond.
In the embodiment of the present invention, the count value of the privately owned Thread Count batching counter in the thread role management unit is less than When the privately owned number of threads maximum value of the thread role management unit, then it is assumed that can also be from the privately owned number of threads of the group It accelerates, i.e., selects a thread to distribute to task from thread pool.
Further, the quantity according to the thread that can be called in the thread thread role management unit, from thread Thread is called to distribute to the task in pond, comprising:
If it is determined that the count value of the privately owned Thread Count batching counter in the thread role management unit is not less than the line The privately owned number of threads maximum value of the corresponding task of the thread role management unit can be distributed in journey role management unit, then Judge the privately owned Thread Count batching counter in the thread role management unit count value and the thread role management unit In share the sum of count value of Thread Count batching counter and whether be less than in the thread role management unit and can distribute to the line It can be distributed in the privately owned number of threads maximum value of the corresponding task of journey role management unit and the thread role management unit To the shared thread of the corresponding task of the thread role management unit and the corresponding task of other thread role management units The sum of quantity maximum value;
If the count value of the privately owned Thread Count batching counter in the thread role management unit and the thread task pipe It is described less than that can distribute in the thread role management unit that the sum of count value of Thread Count batching counter is shared in reason unit It can divide in the privately owned number of threads maximum value of the corresponding task of thread role management unit and the thread role management unit The common lines of the corresponding task of thread role management unit described in dispensing and the corresponding task of other thread role management units The sum of number of passes amount maximum value then selects a thread as the distribution thread of the task in thread pool.
In the embodiment of the present invention, if the count value of the privately owned Thread Count batching counter in the thread role management unit is not Less than the privately owned number of threads maximum value of the thread role management unit, and it is privately owned in the thread role management unit The sum of the count value of Thread Count batching counter is shared in the count value of number of threads counter and the thread role management unit Less than the privately owned number of threads maximum value and the sum of the shared number of threads maximum value in the thread role management unit, then Thinking can also be from the thread called in thread pool in the thread role management unit, i.e., selection one thread point from thread pool Dispensing task.
Further, the quantity according to the thread that can be called in the thread thread role management unit, from thread After calling thread to distribute to the task in pond, further includes:
Update the count value of the privately owned Thread Count batching counter in the thread role management unit.
In the embodiment of the present invention, in thread role management unit after having invoked thread in thread pool, need to update described The count value of privately owned Thread Count batching counter in thread role management unit is more accurately appointed for next thread that corresponds to Task in administrative unit of being engaged in distributes thread.
Further, the method also includes:
If the count value of the privately owned Thread Count batching counter in the thread role management unit and the thread task pipe The sum of count value of shared Thread Count batching counter, which is not less than in the thread role management unit, in reason unit can distribute to institute Stating can in the privately owned number of threads maximum value and the thread role management unit of the corresponding task of thread role management unit Distribute to the shared of the corresponding task of the thread role management unit and the corresponding task of other thread role management units The sum of number of threads maximum value is then appointed according to other threads that the shared thread role management unit conditional search of lookup meets condition Business administrative unit searches other thread role management units corresponding with the shared thread condition of the lookup, and utilizes the line Journey role management unit selects a thread as the distribution thread of the task in the thread pool;
Wherein, described to search the shared Thread Count batching counter that shared thread condition is the thread role management unit Count value be less than the thread role management unit in can distribute to the corresponding task of the thread role management unit and its The shared number of threads maximum value of its corresponding task of thread role management unit, and it is privately owned in the thread role management unit The sum of the count value of Thread Count batching counter is shared in the count value of number of threads counter and the thread role management unit Less than the privately owned Thread Count that can distribute to the corresponding task of the thread role management unit in the thread role management unit Amount maximum value and the thread role management unit in can distribute to the corresponding task of the thread role management unit and The sum of the shared number of threads maximum value of the corresponding task of other thread role management units.
In the embodiment of the present invention, do not have be need after the thread that task can be called in determining the thread TU task unit Whether also can be the thread of task call, the resource in thread pool is more reasonably utilized if searching in other groups.
The present invention also provides a kind of task allocation apparatus based on thread pool, comprising:
Acquiring unit obtains the corresponding thread distribution request of task;
Determination unit determines that the corresponding thread thread of the task is appointed according to the task identification in the thread distribution request Business administrative unit;
Allocation unit, according to the quantity for the thread that can be called in the thread thread role management unit, from thread pool Thread is called to distribute to the task;
Wherein, the quantity of the thread called is the thread that thread role management unit can be called from thread pool Quantity.
In the embodiment of the present invention, the corresponding thread distribution request of task is obtained, and according in the thread distribution request Task identification determines the corresponding thread role management unit of the task, in the corresponding thread role management unit of the task that determined Afterwards, it is that task distribution thread is handled according to the quantity for the thread that thread pool can call in thread role management unit, utilizes Different thread role management units more accurately can distribute thread for task, and according to each thread role management unit In the quantity of the thread called be that task in the role management unit distributes thread, improve as task distribution Efficiency and accuracy rate.
Further, described device further include:
The quantity determination unit for the thread that can be called, for according to that can be distributed in the thread role management unit It can be distributed in the privately owned number of threads maximum value of the corresponding task of thread role management unit, the thread role management unit The shared Thread Count of the corresponding task of thread role management unit and the corresponding task of other thread role management units The count value and the shared number of threads of privately owned Thread Count batching counter in amount maximum value, the thread role management unit The count value of counter determines the quantity for the thread that can be called in the thread thread role management unit.
Further, the allocation unit, is specifically used for:
Judge whether the count value of the privately owned Thread Count batching counter in the thread role management unit is less than the line The privately owned number of threads maximum value of the corresponding task of the thread role management unit can be distributed in journey role management unit;
If the count value of the privately owned Thread Count batching counter in the thread role management unit is less than the thread task The privately owned number of threads maximum value that the corresponding task of the thread role management unit can be distributed in administrative unit, then in thread Select a thread as the distribution thread of the task in pond.
Further, the allocation unit, is specifically used for:
If it is determined that the count value of the privately owned Thread Count batching counter in the thread role management unit is not less than the line The privately owned number of threads maximum value of the corresponding task of the thread role management unit can be distributed in journey role management unit, then Judge the privately owned Thread Count batching counter in the thread role management unit count value and the thread role management unit In share the sum of count value of Thread Count batching counter and whether be less than in the thread role management unit and can distribute to the line It can be distributed in the privately owned number of threads maximum value of the corresponding task of journey role management unit and the thread role management unit To the shared thread of the corresponding task of the thread role management unit and the corresponding task of other thread role management units The sum of quantity maximum value;
If the count value of the privately owned Thread Count batching counter in the thread role management unit and the thread task pipe It is described less than that can distribute in the thread role management unit that the sum of count value of Thread Count batching counter is shared in reason unit It can divide in the privately owned number of threads maximum value of the corresponding task of thread role management unit and the thread role management unit The common lines of the corresponding task of thread role management unit described in dispensing and the corresponding task of other thread role management units The sum of number of passes amount maximum value then selects a thread as the distribution thread of the task in thread pool.
Further, described device further include:
Counter updating unit, by updating based on the privately owned Thread Count batching counter in the thread role management unit Numerical value.
Further, described device further include:
Searching unit, if count value and institute for the privately owned Thread Count batching counter in the thread role management unit The sum of count value that Thread Count batching counter is shared in thread role management unit is stated not less than the thread role management unit In can distribute to the privately owned number of threads maximum value and the thread task of the corresponding task of the thread role management unit The corresponding task of the thread role management unit can be distributed in administrative unit and other thread role management units are corresponding The sum of the shared number of threads maximum value of task, then meet condition according to searching shared thread role management unit conditional search Other thread role management units, search and share the corresponding other thread role management units of thread condition with described search, And select a thread as the distribution thread of the task in the thread pool using the thread role management unit;
Wherein, described to search the shared Thread Count batching counter that shared thread condition is the thread role management unit Count value be less than the thread role management unit in can distribute to the corresponding task of the thread role management unit and its The shared number of threads maximum value of its corresponding task of thread role management unit, and it is privately owned in the thread role management unit The sum of the count value of Thread Count batching counter is shared in the count value of number of threads counter and the thread role management unit Less than the privately owned Thread Count that can distribute to the corresponding task of the thread role management unit in the thread role management unit Amount maximum value and the thread role management unit in can distribute to the corresponding task of the thread role management unit and The sum of the shared number of threads maximum value of the corresponding task of other thread role management units.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly introduced, it should be apparent that, drawings in the following description are only some embodiments of the invention, for this For the those of ordinary skill in field, without any creative labor, it can also be obtained according to these attached drawings His attached drawing.
Fig. 1 is a kind of flow chart of the method for allocating tasks based on thread pool provided in an embodiment of the present invention;
Fig. 2 is the structural schematic diagram of thread pool provided in an embodiment of the present invention;
Fig. 3 is the structural schematic diagram of thread role management unit provided in an embodiment of the present invention;
Fig. 4 is the flow chart of another method for allocating tasks based on thread pool provided in an embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of the task allocation apparatus based on thread pool provided in an embodiment of the present invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention make into It is described in detail to one step, it is clear that the described embodiments are only some of the embodiments of the present invention, rather than whole implementation Example.Based on the embodiments of the present invention, obtained by those of ordinary skill in the art without making creative efforts All other embodiment, shall fall within the protection scope of the present invention.
The present invention provides a kind of method for allocating tasks based on thread pool, as shown in Figure 1, comprising:
Step 101, the corresponding thread distribution request of task is obtained;
Step 102, determine that the corresponding thread thread of the task is appointed according to the task identification in the thread distribution request Business administrative unit;
Step 103, it according to the quantity for the thread that can be called in the thread thread role management unit, is adjusted from thread pool The task is distributed to thread;
Wherein, the quantity of the thread called is the thread that thread role management unit can be called from thread pool Quantity.
In embodiments of the present invention, thread is the minimum unit that program executes stream, is that CPU (central processing unit) is dispatched and divided The basic unit of group.And thread pool is a kind of multiple threads form, and task is added to queue in treatment process, is then being created It builds and starts these tasks after thread automatically.Thread pool threads are all background threads.Per thread all uses the storehouse size of default, It is run with the priority of default, and in multiple thread units.As shown in Fig. 2, having multiple threads in thread pool, can call Thread in thread pool executes task.Wherein part A is the thread that can be called in thread pool.
In embodiments of the present invention, in embodiments of the present invention, first according to the quantity and CPU of the thread in thread pool Processing capacity and the executive condition etc. of thread determine multiple thread role management units, multiple thread role management unit energy The thread in thread pool is enough called to distribute to the task corresponding to the thread role management unit or correspond to other threads The task of role management unit.
For example, maximum permission number of threads is MAX in thread poolTotal, can be according to MAXTotalQuantity be divided into Multiple thread role management units, or divided according to the priority of thread execution task, according to priority height into Row establishes multiple thread role management units.
Optionally, in embodiments of the present invention, the priority of being executed according to thread for task, executes time-consuming at request frequency The features such as, determine different thread role management units.In the mission thread distribution request for the task that receives, in acquisition request Task identification, in embodiments of the present invention, task identification is also according to the priority of task, request frequency, executes time-consuming etc. What feature determined, the corresponding relationship of thread role management unit and task identification is saved in table 1, can be determined and be appointed according to table 1 It is engaged in corresponding thread role management unit:
Task identification Thread role management unit
Task identification 1 Thread role management unit 1
Task identification 2 Thread role management unit 2
…… ……
Task identification n Thread role management unit Tn
Table 1: the mapping table of thread role management unit and task identification
After the corresponding thread role management unit of the task that determined, need to check that the thread role management unit can call Number of threads, in embodiments of the present invention, the number of threads that can be called in thread role management unit be m, that is to say, that should Thread role management unit can also call thread for m task from thread pool.
In embodiments of the present invention, the sum for the number of threads that can be called in all thread role management units is thread pool In total number of threads be MAXTotal
In order to preferably describe the thread occupancy situation in thread role management unit, in embodiments of the present invention, use The privately owned number of threads of the corresponding task of the thread role management unit can be distributed in the thread role management unit most The corresponding task of the thread role management unit and other threads can be distributed in big value, the thread role management unit Privately owned number of threads in the shared number of threads maximum value of the corresponding task of role management unit, the thread role management unit The count value of the count value of counter and the shared Thread Count batching counter, determines the thread thread role management unit In the quantity of thread that can call.
Optionally, in embodiments of the present invention, it before the corresponding thread distribution request of the task of acquisition, needs to initialize each Thread role management unit, and be numbered for per thread role management unit, as shown in figure 3, if having n thread task pipe Manage unit, then the number of different thread role management units be T1, T2, T3 ..., TN.
After the number for initializing each thread role management unit, it is thus necessary to determine that private in per thread role management unit There is number of threads maximum value MAX1, i.e., can be the thread distributed corresponding to the task of reorganization in the thread role management unit Maximum value is denoted as Tm.MAX1, wherein Tm ∈ T1, T2, T3 ..., TN, determine privately owned in per thread role management unit The count value QN of number of threads counter, is denoted as Tm.QN, in the initial state Tm.QN=0.
It determines and shares number of threads maximum value MAX2, i.e. the thread role management unit in per thread role management unit In both can for corresponding to the thread role management unit task distribute thread may be corresponding to other thread task pipes The maximum value for managing the task distribution number of threads of unit, is denoted as Tm.MAX2, wherein determine in per thread role management unit The count value SN of privately owned Thread Count batching counter, is denoted as Tm.SN, in the initial state Tm.SN=0.In embodiments of the present invention, The sum of Tm.MAX1 and Tm.MAX2 are the maximum value for the thread that can be distributed in the thread role management unit.
In the above embodiment of the present invention, since each thread role management unit is according to corresponding to thread task management list What task significance level, request frequency, execution time-consuming in member etc. were divided, and the task in thread role management unit It is to be marked according to the significance level of task, request frequency, execution time-consuming etc., convenient for the management of task, reasonable distribution money Source.And due to each thread role management unit be it is independently operated, do not influence other thread role management units request appoint The execution of business, be able to achieve thread resources exclusively enjoys space and certain communal space.
In embodiments of the present invention, after the thread distribution request for the task that gets, the corresponding thread task of task is determined Administrative unit, for example, in embodiments of the present invention, it is determined that the thread role management unit of task a is Ta, according to thread task Thread occupancy situation in administrative unit Ta distributes thread for task a.
In embodiments of the present invention, after the thread role management unit for determining task a is Ta, it is also necessary to determine Ta line Privately owned number of threads maximum value in journey role management unit is Ta.MAX1, shares Thread Count in Ta thread role management unit Amount maximum value is Ta.MAX2, and the count value of privately owned Thread Count batching counter is Ta.QN, shares the counting of Thread Count batching counter Value is Ta.SN.
When Ta thread role management unit gets distribution thread request, it is necessary first to judge Ta thread task management list Whether Ta.QN is less than Ta.MAX1 in member, if Ta.QN < Ta.MAX1, then it is assumed that there are also not in Ta thread role management unit Occupied virtual privately owned thread can use, then chooses a thread from thread pool and distribute to task a, and will be described The quantity of Ta.QN adds 1, updates the Ta.QN.
For example, in embodiments of the present invention, Ta.QN=5, that is to say, that in the thread role management unit, there is 5 Thread has selected thread to distribute to task in thread pool, and the thread in thread pool is carrying out task, Ta.MAX1 =10, that is to say, that in the thread role management unit, can there are 10 privately owned threads to select in thread pool simultaneously Thread distributes to task, and the thread that can be up in 10 thread pools is performed simultaneously task, when Ta.QN < has been determined When Ta.MAX1, i.e., in the thread role management unit, task is distributed to there are also 5 privately owned threads, so just from thread pool It selects a thread to distribute to task a, and the value of Ta.QN is updated to 6, indicate occupied now with 6 privately owned threads.
In embodiments of the present invention, after the thread being assigned in thread pool has executed task, the value of Ta.QN is updated to 5, That is, having there is a thread to execute task in thread pool, it is in idle condition, so increasing an assignable private There is thread.
In embodiments of the present invention, however, it is determined that Ta.QN is not less than Ta.MAX1, i.e. Ta.QN in Ta thread role management unit >=Ta.MAX1, that is to say, that in the thread role management unit, can call to the thread role management unit corresponding The privately owned thread of business all obtains thread from thread pool, and the thread is carrying out task, not available Privately owned thread can distribute, at this point, then needing to continue to determine the privately owned Thread Count batching counter of thread role management unit Ta Count value Ta.QN and the count value of shared Thread Count batching counter of thread role management unit Ta be the sum of Ta.SN, and The size relation of the sum of thread role management unit Ta.MAX1 and thread role management unit Ta.MAX2, however, it is determined that Ta.QN+Ta.SN < Ta.MAX1+Ta.MAX2, i.e., in the thread role management unit, although not having in the privately owned thread that can be called Having in shared thread or can have thread to be allocated to the task of thread to be allocated, at this point, just from line Cheng Chizhong chooses a thread and distributes to task, and the number of the Ta.QN in the thread role management unit is carried out to add 1.
For example, in embodiments of the present invention, when determining Ta.QN=15, Ta.SN=8, Ta.MAX1=10, Ta.SN=15, Ta.QN+Ta.SN < Ta.MAX1+Ta.MAX2, then it is assumed that can also there are 2 threads can be used in shared thread, then from thread It selects a thread to distribute to task a in pond, and the count value of Ta.QN is updated to 16.
Likewise, in the above embodiment of the present invention, after the thread being assigned in thread pool has executed task, Ta.QN Value be updated to 15, that is to say, that there is a thread to execute task in thread pool, be in idle condition, thus increase One assignable privately owned thread.
In embodiments of the present invention, when determining Ta.QN+Ta.SN >=Ta.MAX1+Ta.MAX2, i.e., the thread is appointed at this time The sum of privately owned thread and shared thread have been over the maximum value of the thread role management unit in business administrative unit, this When, which can not continue as the task distribution thread corresponding to the thread role management unit, Due to having the count value of shared thread counter in each thread role management unit, and having can be for corresponding to other line The quantity of the thread in task call thread pool in journey role management unit, then the thread role management unit can not be after Continue to need replacing as other thread role management units when the task of the thread role management unit distributes thread.
In embodiments of the present invention, what is if desired searched can be that the thread role management unit of task distribution thread is STm, then determine STm.MAX2 > 0 first, i.e. the maximum value of shared number of threads in the thread role management unit is greater than 0 , i.e., there is shared thread in the thread role management unit, but do not know whether common lines journey is all occupied.
Then continue to determine, if STm meets following two condition simultaneously, then it is assumed that thread can be distributed in the STm for task:
Condition one: the count value SN of the shared Thread Count batching counter in the thread role management unit appoints less than the thread Number of threads the maximum value MAX2, i.e. STm.SN < STm.MAX2 of thread are shared in administrative unit of being engaged in;
Condition two: the count value QN and the thread task of the privately owned Thread Count batching counter in the thread role management unit The sum of the count value SN that Thread Count batching counter is shared in administrative unit, is less than privately owned Thread Count in the thread role management unit It measures and shares the sum of number of threads maximum value MAX2 in maximum value MAX1 and the thread role management unit.That is: STm.QN+STm.SN <STm.MAX1+STm.MAX2
In the above embodiment of the present invention, condition one determined the STm.SN in the thread role management unit < STm.MAX2, i.e. shared thread in the thread role management unit be not also completely occupied, can also have shared thread to distribute To task.Condition two determined in the thread role management unit, STm.SN < STm.MAX2 and STm.QN+STm.SN < STm.MAX1+STm.MAX2, the i.e. privately owned thread to work in the thread role management unit and shared thread do not have Reach the maximum thread of the thread role management unit, then a thread can be selected to distribute to task from thread pool, and more The value of STm.SN, increases the value of STm.SN in the new thread role management unit.
Optionally, in embodiments of the present invention, if inquire meet above-mentioned condition thread role management unit have it is multiple, Thread, the high thread task pipe of priority are then allocated to task according to the priority of the multiple thread role management unit Reason unit obtains task first, and distributes thread to task.
In embodiments of the present invention, after the thread in thread pool has executed task, after having completion task in thread pool Idle thread reduces the value of STm.SN so needing to update the value of the STm.SN in the thread role management unit.
In the above embodiment of the present invention, if inquiry is less than the thread task management list for meeting above-mentioned two condition simultaneously Member, then it is assumed that the thread in thread pool is all in working condition at this time, without assignable thread, so at this time, it may be necessary to judging The task retries row number.
Optionally, in embodiments of the present invention, when the thread distribution request for the task that gets, the thread distribution request In further comprise the task retry row number, i.e. the task number that has carried out thread distribution request.
When determine the task retry that row number is less than setting retry row frequency threshold value, then it is assumed that the task can be with Continue thread distribution request, optionally, in embodiments of the present invention, retrying row frequency threshold value can be according to the processing of CPU Ability determines.
In embodiments of the present invention, when the row number of retrying for determining the task retries row frequency threshold value less than setting Afterwards, then the task is put into task dispatching to wait in sequence, capable notice is retried in waiting.
In embodiments of the present invention, after the thread in thread pool idles setting time, i.e. line in thread pool at this time Journey then sends without completely occupied and retries capable notice, then asks from the thread distribution that task dispatching waits for sequentially obtaining task in sequence Ask, and update the task retry row number after, re-execute thread distribution the step of.
In embodiments of the present invention, however, it is determined that the row number of retrying of the task retries row number threshold not less than setting Value, then it is assumed that the task can be dropped, and the operation of thread is no longer allocated to the task.
Illustrate the embodiment of the present invention in order to more detailed, illustrates herein.
As shown in figure 4, the embodiment of the present invention provides a kind of method for allocating tasks based on thread pool, wherein if there is n line Journey role management unit, then the number of different thread role management units be T1, T2, T3 ..., TN, per thread task Privately owned number of threads maximum value MAX1, is denoted as Tm.MAX1 in administrative unit, wherein Tm ∈ T1, T2, T3 ..., TN, each The count value QN of privately owned Thread Count batching counter, is denoted as Tm.QN in thread role management unit, determines per thread task management Number of threads maximum value MAX2 is shared in unit, is denoted as Tm.MAX2, privately owned Thread Count meter in per thread role management unit The count value SN of number device, is denoted as Tm.SN, and it is shown that specific step is as follows:
Step 401, the thread distribution request of task is obtained, wherein including the task in the thread distribution request Task identification and the task retry row number;
Step 402, the corresponding thread role management unit of the task is determined according to the task identification of the task;
Step 403, judge whether Tm.QN is less than Tm.QN in the thread role management unit, if Tm.QN < Tm.MAX1 thens follow the steps 404;It is no to then follow the steps 406;
Step 404, a thread is chosen from thread pool and distributes to task, and the quantity of the Tm.QN is added 1, is updated The Tm.QN;
Step 405, after the thread being assigned in thread pool has executed task, it is updated to the value of Tm.QN;
Step 406, judge whether the sum of Tm.QN+Tm.SN is less than the sum of Tm.MAX1+Tm.MAX2, if satisfied, then executing Step 407;It is no to then follow the steps 409;
Step 407, a thread is chosen from thread pool and distributes to task, and the quantity of the Tm.SN is added 1, is updated The Tm.QN;
Step 408, after the thread being assigned in thread pool has executed task, it is updated to the value of Tm.QN;
Step 409, other thread role management unit ST are traversed, judge whether meet in other thread role management units STm.SN < STm.MAX2, if satisfied, 410 are thened follow the steps, it is no to then follow the steps 413;
Step 410, judge whether meet STm.QN+STm.SN < STm.MAX1+ in the thread role management unit STm.MAX2, if satisfied, thening follow the steps 411;It is no to then follow the steps 413;
Step 411, a thread is chosen from thread pool and distributes to task, and the quantity of the STm.SN is added 1, is updated The STm.SN;
Step 412, after the thread being assigned in thread pool has executed task, it is updated to the value of STm.SN;
Step 413, judge the task re-execute whether number be greater than setting re-execute frequency threshold value, if being less than Frequency threshold value is re-executed, thens follow the steps 414, it is no to then follow the steps 415;
Step 414, task is added to task dispatching and waits for sequence, waited after receiving the notice re-executed, execute step 401;
Step 415, give up the task, no longer distribute thread for task.
Based on identical inventive concept, the embodiment of the present invention also provides a kind of task allocation apparatus based on thread pool, should Device can execute the above method.As shown in Figure 5, comprising:
Acquiring unit 501 obtains the corresponding thread distribution request of task;
Determination unit 502 determines the corresponding thread line of the task according to the task identification in the thread distribution request Journey role management unit;
Allocation unit 503, according to the quantity for the thread that can be called in the thread thread role management unit, from thread pool Middle calling thread distributes to the task;
Wherein, the quantity of the thread called is the thread that thread role management unit can be called from thread pool Quantity.
Further, described device further include:
The quantity determination unit 504 for the thread that can be called, for that can be distributed to according in the thread role management unit It can divide in the privately owned number of threads maximum value of the corresponding task of the thread role management unit, the thread role management unit The common lines of the corresponding task of thread role management unit described in dispensing and the corresponding task of other thread role management units The count value of privately owned Thread Count batching counter and the shared thread in number of passes amount maximum value, the thread role management unit The count value of number counter determines the quantity for the thread that can be called in the thread thread role management unit.
Further, the allocation unit 503, is specifically used for:
Judge whether the count value of the privately owned Thread Count batching counter in the thread role management unit is less than the line The privately owned number of threads maximum value of the corresponding task of the thread role management unit can be distributed in journey role management unit;
If the count value of the privately owned Thread Count batching counter in the thread role management unit is less than the thread task The privately owned number of threads maximum value that the corresponding task of the thread role management unit can be distributed in administrative unit, then in thread Select a thread as the distribution thread of the task in pond.
Further, the allocation unit 503, is specifically used for:
If it is determined that the count value of the privately owned Thread Count batching counter in the thread role management unit is not less than the line The privately owned number of threads maximum value of the corresponding task of the thread role management unit can be distributed in journey role management unit, then Judge the privately owned Thread Count batching counter in the thread role management unit count value and the thread role management unit In share the sum of count value of Thread Count batching counter and whether be less than in the thread role management unit and can distribute to the line It can be distributed in the privately owned number of threads maximum value of the corresponding task of journey role management unit and the thread role management unit To the shared thread of the corresponding task of the thread role management unit and the corresponding task of other thread role management units The sum of quantity maximum value;
If the count value of the privately owned Thread Count batching counter in the thread role management unit and the thread task pipe It is described less than that can distribute in the thread role management unit that the sum of count value of Thread Count batching counter is shared in reason unit It can divide in the privately owned number of threads maximum value of the corresponding task of thread role management unit and the thread role management unit The common lines of the corresponding task of thread role management unit described in dispensing and the corresponding task of other thread role management units The sum of number of passes amount maximum value then selects a thread as the distribution thread of the task in thread pool.
Further, described device further include:
Counter updating unit 505, for updating the privately owned Thread Count batching counter in the thread role management unit Count value.
Further, described device further include:
Searching unit 506, if the count value for the privately owned Thread Count batching counter in the thread role management unit It is not less than the thread task management with the sum of the count value for sharing Thread Count batching counter in the thread role management unit Can be distributed in unit the corresponding task of the thread role management unit privately owned number of threads maximum value and the thread The corresponding task of the thread role management unit and other thread role management units can be distributed in role management unit The sum of shared number of threads maximum value of corresponding task then meets according to the shared thread role management unit conditional search of lookup Other thread role management units of condition search other thread task management lists corresponding with the shared thread condition of the lookup Member, and select a thread as the distribution line of the task in the thread pool using the thread role management unit Journey;
Wherein, described to search the shared Thread Count batching counter that shared thread condition is the thread role management unit Count value be less than the thread role management unit in can distribute to the corresponding task of the thread role management unit and its The shared number of threads maximum value of its corresponding task of thread role management unit, and it is privately owned in the thread role management unit The sum of the count value of Thread Count batching counter is shared in the count value of number of threads counter and the thread role management unit Less than the privately owned Thread Count that can distribute to the corresponding task of the thread role management unit in the thread role management unit Amount maximum value and the thread role management unit in can distribute to the corresponding task of the thread role management unit and The sum of the shared number of threads maximum value of the corresponding task of other thread role management units.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (10)

1. a kind of method for allocating tasks based on thread pool, which is characterized in that the described method includes:
The corresponding thread distribution request of acquisition task;
The corresponding thread role management unit of the task is determined according to the task identification in the thread distribution request;
According to the quantity for the thread that can be called in the thread role management unit, calling thread is distributed to described from thread pool Task;
Wherein, the quantity of the thread called is the Thread Count that thread role management unit can be called from thread pool Amount;
Wherein, the quantity that the thread that can be called in the thread role management unit is determined according to following manner:
According to the privately owned line that can distribute to the corresponding task of the thread role management unit in the thread role management unit Can be distributed in number of passes amount maximum value, the thread role management unit the corresponding task of the thread role management unit and It is privately owned in the shared number of threads maximum value of the corresponding task of other thread role management units, the thread role management unit The count value of the count value of number of threads counter and the shared Thread Count batching counter, determines the thread task management The quantity for the thread that can be called in unit.
2. the method according to claim 1, wherein described can call according in the thread role management unit Thread quantity, from thread pool call thread distribute to the task, comprising:
Judge whether the count value of the privately owned Thread Count batching counter in the thread role management unit is less than the thread and appoints The privately owned number of threads maximum value of the corresponding task of the thread role management unit can be distributed in business administrative unit;
If the count value of the privately owned Thread Count batching counter in the thread role management unit is less than the thread task management The privately owned number of threads maximum value that the corresponding task of the thread role management unit can be distributed in unit, then in thread pool Select a thread as the distribution thread of the task.
3. according to the method described in claim 2, it is characterized in that, described can call according in the thread role management unit Thread quantity, from thread pool call thread distribute to the task, comprising:
If it is determined that the count value of the privately owned Thread Count batching counter in the thread role management unit is appointed not less than the thread The privately owned number of threads maximum value that the corresponding task of the thread role management unit can be distributed in business administrative unit, then judge In the count value of privately owned Thread Count batching counter in the thread role management unit and the thread role management unit altogether Enjoy the sum of count value of number of threads counter whether be less than the thread role management unit in can distribute to the thread appoint Institute can be distributed in the privately owned number of threads maximum value of the corresponding task of business administrative unit and the thread role management unit State the shared number of threads of the corresponding task of thread role management unit and the corresponding task of other thread role management units The sum of maximum value;
If the count value of the privately owned Thread Count batching counter in the thread role management unit and the thread task management list The sum of the count value that Thread Count batching counter is shared in member, which is less than in the thread role management unit, can distribute to the thread It can be distributed in the privately owned number of threads maximum value of the corresponding task of role management unit and the thread role management unit The shared Thread Count of the corresponding task of thread role management unit and the corresponding task of other thread role management units The sum of maximum value is measured, then selects a thread as the distribution thread of the task in thread pool.
4. according to the method in claim 2 or 3, which is characterized in that described according to can in the thread role management unit The quantity of the thread of calling, after calling thread to distribute to the task in thread pool, further includes:
Update the count value of the privately owned Thread Count batching counter in the thread role management unit.
5. according to the method described in claim 3, it is characterized in that, the method also includes:
If the count value of the privately owned Thread Count batching counter in the thread role management unit and the thread task management list The sum of count value that Thread Count batching counter is shared in member, which is not less than in the thread role management unit, can distribute to the line It can be distributed in the privately owned number of threads maximum value of the corresponding task of journey role management unit and the thread role management unit To the shared thread of the corresponding task of the thread role management unit and the corresponding task of other thread role management units The sum of quantity maximum value then meets other thread task pipes of condition according to the shared thread role management unit conditional search of lookup Unit is managed, and selects a thread as the distribution of the task in the thread pool using the thread role management unit Thread;
Wherein, described to search the shared number of threads that shared thread role management unit condition is the thread role management unit The count value of counter, which is less than in the thread role management unit, can distribute to corresponding of the thread role management unit The shared number of threads maximum value of business and the corresponding task of other thread role management units, and the thread task management list The count value of privately owned Thread Count batching counter and the meter that Thread Count batching counter is shared in the thread role management unit in member The sum of numerical value is less than in the thread role management unit private that can distribute to the corresponding task of the thread role management unit Have that can to distribute to the thread role management unit in number of threads maximum value and the thread role management unit corresponding The sum of task and the shared number of threads maximum value of the corresponding task of other thread role management units.
6. a kind of task allocation apparatus based on thread pool characterized by comprising
Acquiring unit obtains the corresponding thread distribution request of task;
Determination unit determines the corresponding thread task management list of the task according to the task identification in the thread distribution request Member;
Allocation unit calls thread according to the quantity for the thread that can be called in the thread role management unit from thread pool Distribute to the task;
Wherein, the quantity of the thread called is the Thread Count that thread role management unit can be called from thread pool Amount;Wherein, described device further include:
The quantity determination unit for the thread that can be called, for the thread can be distributed to according in the thread role management unit It can be distributed in the privately owned number of threads maximum value of the corresponding task of role management unit, the thread role management unit described The shared number of threads of the corresponding task of thread role management unit and the corresponding task of other thread role management units is most The count value of privately owned Thread Count batching counter and the shared Thread Count meter number in big value, the thread role management unit The count value of device determines the quantity for the thread that can be called in the thread role management unit.
7. device according to claim 6, which is characterized in that the allocation unit is specifically used for:
Judge whether the count value of the privately owned Thread Count batching counter in the thread role management unit is less than the thread and appoints The privately owned number of threads maximum value of the corresponding task of the thread role management unit can be distributed in business administrative unit;
If the count value of the privately owned Thread Count batching counter in the thread role management unit is less than the thread task management The privately owned number of threads maximum value that the corresponding task of the thread role management unit can be distributed in unit, then in thread pool Select a thread as the distribution thread of the task.
8. device according to claim 7, which is characterized in that the allocation unit is specifically used for:
If it is determined that the count value of the privately owned Thread Count batching counter in the thread role management unit is appointed not less than the thread The privately owned number of threads maximum value that the corresponding task of the thread role management unit can be distributed in business administrative unit, then judge In the count value of privately owned Thread Count batching counter in the thread role management unit and the thread role management unit altogether Enjoy the sum of count value of number of threads counter whether be less than the thread role management unit in can distribute to the thread appoint Institute can be distributed in the privately owned number of threads maximum value of the corresponding task of business administrative unit and the thread role management unit State the shared number of threads of the corresponding task of thread role management unit and the corresponding task of other thread role management units The sum of maximum value;
If the count value of the privately owned Thread Count batching counter in the thread role management unit and the thread task management list The sum of the count value that Thread Count batching counter is shared in member, which is less than in the thread role management unit, can distribute to the thread It can be distributed in the privately owned number of threads maximum value of the corresponding task of role management unit and the thread role management unit The shared Thread Count of the corresponding task of thread role management unit and the corresponding task of other thread role management units The sum of maximum value is measured, then selects a thread as the distribution thread of the task in thread pool.
9. device according to claim 7 or 8, which is characterized in that described device further include:
Counter updating unit, for updating the counting of the privately owned Thread Count batching counter in the thread role management unit Value.
10. device according to claim 8, which is characterized in that described device further include:
Searching unit, if count value and the line for the privately owned Thread Count batching counter in the thread role management unit The sum of the count value that Thread Count batching counter is shared in journey role management unit can not less than in the thread role management unit Distribute to the privately owned number of threads maximum value and the thread task management of the corresponding task of the thread role management unit The corresponding task of the thread role management unit and corresponding of other thread role management units can be distributed in unit The sum of the shared number of threads maximum value of business, then according to search shared thread role management unit conditional search meet condition its Its thread role management unit, and select a thread as institute in the thread pool using the thread role management unit State the distribution thread of task;
Wherein, described to search the shared number of threads that shared thread role management unit condition is the thread role management unit The count value of counter, which is less than in the thread role management unit, can distribute to corresponding of the thread role management unit The shared number of threads maximum value of business and the corresponding task of other thread role management units, and the thread task management list The count value of privately owned Thread Count batching counter and the meter that Thread Count batching counter is shared in the thread role management unit in member The sum of numerical value is less than in the thread role management unit private that can distribute to the corresponding task of the thread role management unit Have that can to distribute to the thread role management unit in number of threads maximum value and the thread role management unit corresponding The sum of task and the shared number of threads maximum value of the corresponding task of other thread role management units.
CN201610580284.5A 2016-07-21 2016-07-21 A kind of method for allocating tasks and device based on thread pool Active CN106095590B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610580284.5A CN106095590B (en) 2016-07-21 2016-07-21 A kind of method for allocating tasks and device based on thread pool

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610580284.5A CN106095590B (en) 2016-07-21 2016-07-21 A kind of method for allocating tasks and device based on thread pool

Publications (2)

Publication Number Publication Date
CN106095590A CN106095590A (en) 2016-11-09
CN106095590B true CN106095590B (en) 2019-05-03

Family

ID=57449066

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610580284.5A Active CN106095590B (en) 2016-07-21 2016-07-21 A kind of method for allocating tasks and device based on thread pool

Country Status (1)

Country Link
CN (1) CN106095590B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106940658B (en) * 2017-02-21 2022-09-09 腾讯科技(深圳)有限公司 Task processing method and device based on thread pool
CN107357640B (en) * 2017-06-30 2021-06-11 北京奇虎科技有限公司 Request processing method and device for multi-thread database and electronic equipment
CN109426561A (en) * 2017-08-29 2019-03-05 阿里巴巴集团控股有限公司 A kind of task processing method, device and equipment
CN107678838B (en) * 2017-10-19 2021-07-02 郑州云海信息技术有限公司 Method and device for tracking operation of virtual machine and virtual machine management platform
CN108846632A (en) * 2018-05-28 2018-11-20 浙江口碑网络技术有限公司 Thread processing method and device
CN109388485B (en) * 2018-09-26 2021-01-22 广州虎牙信息科技有限公司 Processing method, device and equipment of task execution thread and storage medium
CN109814994B (en) * 2019-01-03 2021-10-08 福建天泉教育科技有限公司 Method and terminal for dynamically scheduling thread pool
CN110515715A (en) * 2019-08-22 2019-11-29 北京宝兰德软件股份有限公司 Task processing method and device based on thread pool
CN110888742A (en) * 2019-11-28 2020-03-17 北京小米移动软件有限公司 Thread management method, device and system
CN111259555B (en) * 2020-01-20 2022-03-29 西北工业大学 Petroleum pipeline equidistant line generation method based on thread pool
CN111324454A (en) * 2020-02-03 2020-06-23 京东数字科技控股有限公司 Multi-core CPU allocation method and device, electronic equipment and storage medium
CN111767125B (en) * 2020-06-15 2023-07-25 杭州数梦工场科技有限公司 Task execution method, device, electronic equipment and storage medium
CN115348321B (en) * 2022-08-12 2024-04-26 中国建设银行股份有限公司 Data acquisition method and related device based on flow control

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0794490A2 (en) * 1996-03-08 1997-09-10 International Business Machines Corporation Dynamic execution unit management for high performance server system
CN101055533A (en) * 2007-05-28 2007-10-17 中兴通讯股份有限公司 Multithreading processor dynamic EMS memory management system and method
CN101556534A (en) * 2009-04-21 2009-10-14 浪潮电子信息产业股份有限公司 Large-scale data parallel computation method with many-core structure
CN101739293A (en) * 2009-12-24 2010-06-16 航天恒星科技有限公司 Method for scheduling satellite data product production tasks in parallel based on multithread
CN102122252A (en) * 2011-03-14 2011-07-13 华中科技大学 Method for designing thread pool capable of ensuring temporal succession
CN102591721A (en) * 2011-12-30 2012-07-18 北京新媒传信科技有限公司 Method and system for distributing thread execution task

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7467390B2 (en) * 2003-04-01 2008-12-16 International Business Machines Corporation Enhanced staged event-driven architecture

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0794490A2 (en) * 1996-03-08 1997-09-10 International Business Machines Corporation Dynamic execution unit management for high performance server system
CN101055533A (en) * 2007-05-28 2007-10-17 中兴通讯股份有限公司 Multithreading processor dynamic EMS memory management system and method
CN101556534A (en) * 2009-04-21 2009-10-14 浪潮电子信息产业股份有限公司 Large-scale data parallel computation method with many-core structure
CN101739293A (en) * 2009-12-24 2010-06-16 航天恒星科技有限公司 Method for scheduling satellite data product production tasks in parallel based on multithread
CN102122252A (en) * 2011-03-14 2011-07-13 华中科技大学 Method for designing thread pool capable of ensuring temporal succession
CN102591721A (en) * 2011-12-30 2012-07-18 北京新媒传信科技有限公司 Method and system for distributing thread execution task

Also Published As

Publication number Publication date
CN106095590A (en) 2016-11-09

Similar Documents

Publication Publication Date Title
CN106095590B (en) A kind of method for allocating tasks and device based on thread pool
US11775429B2 (en) NUMA-aware garbage collection
CN108701059B (en) Multi-tenant resource allocation method and system
US10963376B2 (en) NUMA-aware garbage collection
US8719834B2 (en) Information processing system, method, program and integrated circuit for maintaining balance of processing loads with respect to real-time tasks
US9563474B2 (en) Methods for managing threads within an application and devices thereof
CN110362407A (en) Computing resource dispatching method and device
Chatzistergiou et al. Fast heuristics for near-optimal task allocation in data stream processing over clusters
WO2015117565A1 (en) Methods and systems for dynamically allocating resources and tasks among database work agents in smp environment
US20110247005A1 (en) Methods and Apparatus for Resource Capacity Evaluation in a System of Virtual Containers
US20100325637A1 (en) Allocation of resources to a scheduler in a process
KR20130088513A (en) Task distribution method on multicore system and apparatus thereof
CN106775493B (en) A kind of storage control and I/O Request processing method
CN105912386A (en) Thread management method and system
CN102708003A (en) Method for allocating resources under cloud platform
CN108123980A (en) A kind of resource regulating method and system
KR101770191B1 (en) Resource allocation and apparatus
CN104917839A (en) Load balancing method for use in cloud computing environment
CN115658311A (en) Resource scheduling method, device, equipment and medium
CN103677959B (en) A kind of virtual machine cluster migration method and system based on multicast
CN105874439A (en) Memory pool management method for sharing memory pool among different computing units and related machine readable medium and memory pool management apparatus
CN113010309B (en) Cluster resource scheduling method, device, storage medium, equipment and program product
CN103440113A (en) Disk IO (Input/output) resource allocation method and device
CN108804212A (en) Method and apparatus for the program that task is arranged to cycle
CN108429704B (en) Node resource allocation method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant