CN102591721A - Method and system for distributing thread execution task - Google Patents
Method and system for distributing thread execution task Download PDFInfo
- Publication number
- CN102591721A CN102591721A CN2011104573780A CN201110457378A CN102591721A CN 102591721 A CN102591721 A CN 102591721A CN 2011104573780 A CN2011104573780 A CN 2011104573780A CN 201110457378 A CN201110457378 A CN 201110457378A CN 102591721 A CN102591721 A CN 102591721A
- Authority
- CN
- China
- Prior art keywords
- thread
- task
- threads
- idle
- tasks
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 230000007958 sleep Effects 0.000 claims description 13
- 230000005059 dormancy Effects 0.000 claims description 7
- 230000002618 waking effect Effects 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 3
- 239000002699 waste material Substances 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a method and a system for distributing thread execution task. The method comprises the following steps of: a step 1 of creating a thread pool; a step 2 of creating the task and adding the task into a task queue; a step 3 of calling idle threads in the thread pool and distributing the task in the task queue to the idle threads; and a step 4 of returning an execution result to the task after the threads execute the task. The invention can solve the problems of no feedback of the execution result, insufficient convenience and rapidness of application.
Description
Technical Field
The invention relates to the field of computers, in particular to a method and a system for distributing threads to execute tasks.
Background
In prior art multi-threaded applications, if too many threads are created, the system resources will be occupied, and conflicts between the resource requirements and the potential occupation will also need to be handled. After the multithreading is used, the execution flow and the resource competition situation of the task become complicated, and errors are easy to occur. Thread pools are used in the prior art to address such problems. However, in the thread pool scheme in the prior art, a fixed number of threads are used, and after the execution is completed, no feedback of the execution result exists, and no priority is given to the execution of the task.
In the prior art, the application is not convenient enough because the execution result is not fed back; the number of threads is not flexible enough, so that the waste of system resources is caused; thread scheduling lacks intelligence because tasks are not executed in priority.
Disclosure of Invention
The invention provides a method and a system for distributing a thread execution task, which aim to solve the problems that no execution result is fed back, and the application is not convenient enough.
The invention discloses a method for distributing a thread to execute tasks, which comprises the following steps:
step 1, creating a thread pool;
step 2, creating a task and adding the task into a task queue;
step 3, calling idle threads in the thread pool, and distributing tasks in the task queue to the idle threads;
and 4, after the thread executes the task, returning an execution result to the task.
Wherein the creating task further comprises:
step 21, adding result object parameters and multicast entrusting objects containing task operations into the task;
the step 4 further comprises the following steps:
and step 22, after the thread executes the task, giving an execution result to a result object parameter.
Wherein, after the task is created, the method further comprises:
step 31, setting priority for the created task;
the adding the task into the task queue further comprises:
step 32, adding the created tasks into a task queue according to the sequence of the priorities from high to low;
the step 3 further comprises:
and step 33, calling idle threads in the thread pool, sequentially extracting tasks by taking the head of the task queue as a starting point, and distributing the extracted tasks to the idle threads.
Wherein, the creating the thread pool further comprises:
step 41, executing a thread in a thread pool, where the thread is used for task allocation, and the thread is called an allocation thread;
after the task is added into the task queue, the method further comprises the following steps:
step 42, waking up the distribution thread to distribute tasks;
the step 3 further comprises:
and 43, the allocation thread calls an idle thread in the thread pool, the tasks in the task queue are allocated to the idle thread, and the allocation thread is dormant after the allocation is finished.
Wherein the step 1 further comprises:
step 51, creating threads according to a preset initial thread number, wherein the threads form a thread pool;
said step 43 further comprises:
step 52, allocating threads to search idle threads in the thread pool;
step 53, if an idle thread exists in the thread pool, calling the idle thread, extracting a task from the task queue, distributing the task to the idle thread, and distributing thread dormancy after distribution is finished; otherwise, step 52 is executed after allocating the thread sleep preset duration.
Wherein, the step 52 and the step 53 further comprise:
step 61, determining the number of created threads according to the search result and the number of tasks in the current task queue;
and 62, if the number is not 0, creating the threads according to the number, adding the created threads into the thread pool, and enabling the newly created threads to be idle.
Wherein the method further comprises periodically deleting redundant threads in the thread pool,
step 71, allocating threads to periodically determine the number of redundant threads in a thread pool;
and 72, deleting idle threads according to the number of the redundant threads, and releasing resources occupied by the deleted threads.
Wherein the step 71 further comprises:
step 81A, determining the number of idle threads needed in a thread pool according to the adding time of the last task sequenced in a task queue, the current time, the average number of processing tasks in unit time of threads, the number of tasks in the current task queue and a preset task waiting time threshold;
step 82A, adding the required idle thread number and the currently occupied thread number to obtain a sum value, taking the larger value of the initial thread number and the sum value, and taking the difference value of the current thread number and the larger value in a thread pool as the redundant thread number;
or,
the step 61 further comprises:
step 81B, determining the number of idle threads needed in the thread pool according to the adding time of the last task sequenced in the task queue, the current time, the average number of processing tasks in unit time of the thread, the number of tasks in the current task queue and a preset task waiting time threshold;
and step 82B, adding the required idle thread number and the thread number occupied currently to obtain a sum value, and taking the smaller value of the preset maximum thread number and the sum value, wherein the difference value of the smaller value and the thread number in the current thread pool is the number of the created threads.
Wherein, after the step 43, the method further comprises:
step 91, after the thread executes the task, waking up the distribution thread;
step 92, the distribution thread searches whether a task exists in the task queue, if so, step 43 is executed, otherwise, the distribution thread is dormant;
or,
step 43 is followed by:
step 93, after the thread executes the task, the thread searches whether a task exists in the task queue, if so, the first task in the task queue is extracted, and the task is executed;
or,
step 43 is followed by:
step 94, the allocation thread is awakened periodically, the allocation thread searches whether there is a task in the task queue, if yes, step 43 is executed, otherwise, the allocation thread sleeps.
The invention also discloses a system for distributing the thread to execute the task, which comprises:
the thread pool creating module is used for creating a thread pool;
the task adding module is used for creating a task and adding the task into a task queue;
the task allocation module is used for calling idle threads in the thread pool and allocating tasks in the task queue to the idle threads;
and the result returning module is used for returning the execution result to the task after the thread executes the task.
The embodiment of the invention has the beneficial effects that: the application is more convenient and faster by feeding back the execution result; by executing tasks according to priority, thread scheduling is more intelligent; through dynamic thread quantity adjustment, the threads are more flexibly used, and waste of system resources is reduced.
Drawings
FIG. 1 is a flow chart of a method of assigning threads to perform tasks in accordance with the present invention;
FIG. 2 is a flowchart of an embodiment of a method for allocating threads to execute tasks;
FIG. 3 is a block diagram of a system for assigning threads to perform tasks in accordance with the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Referring to fig. 1, a flow chart of a method for allocating threads to execute tasks according to the present invention is shown.
A method of distributing threads to perform tasks, the method comprising:
step S100, a thread pool is created.
And step S200, creating a task and adding the task into a task queue.
And step S300, calling idle threads in the thread pool, and distributing the tasks in the task queue to the idle threads.
And step S400, after the thread executes the task, returning an execution result to the task.
Further, the creating task further comprises adding result object parameters and a multicast delegate object containing task operations to the task.
The step S400 further includes assigning the execution result to the result object parameter after the thread executes the task.
In a preferred embodiment, threads are invoked to perform tasks at a priority level.
After the task is created, the method further comprises the following steps:
step S210A, sets priorities for the created tasks.
The adding the task into the task queue further comprises:
step S220A, adding the created tasks into the task queue in order of priority from high to low.
The step S300 further includes:
step S310A, call an idle thread in the thread pool, sequentially extract tasks from the head of the task queue, and allocate the extracted tasks to the idle thread.
When the number of idle threads is more than or equal to the number of tasks in the task queue, extracting all tasks in the task queue; and when the number of the idle threads is less than that of the tasks in the task queue, sequentially extracting the tasks with the same number as the idle threads from the head of the task queue.
In a preferred embodiment, thread allocation is performed using an allocation thread.
After the thread pool is created, the method further comprises the following steps:
step S110B, a thread in the thread pool is executed, where the thread is used for task allocation, and the thread is called an allocation thread.
After the task is added into the task queue, the method further comprises the following steps:
in step S210B, the allocation thread is awakened to perform task allocation.
The step S300 further includes:
step S310B, the allocation thread calls an idle thread in the thread pool, allocates the task in the task queue to the idle thread, and allocates the thread to sleep after the allocation is finished.
When the thread is called by the allocated thread, the state is changed to occupied, and after the task is completed, the state is changed to idle.
Further, after a round of task execution is completed, whether tasks waiting to be executed still exist in the task queue is checked.
Viewing is achieved through a variety of implementations. For example, after a thread executes a task, the thread is waken up to be allocated; the allocation thread looks up whether there is a task in the task queue, if so, step S310B is executed, otherwise, the allocation thread sleeps.
Or after the thread executes the task, the thread searches whether the task exists in the task queue, if so, the first task in the task queue is extracted, and the task is executed.
Alternatively, the allocation thread is awakened periodically, the allocation thread searches whether there is a task in the task queue, if so, step S310B is executed, otherwise, the allocation thread sleeps.
By adopting the method, the distributed threads can be enabled to have dormancy, and the tasks in the task queue can be ensured to be extracted and executed in time.
In a preferred embodiment, the thread number in the thread pool adopts a fixed mode, and the fixed mode is suitable for the case that the task amount is relatively fixed.
The step S100 further includes:
step S110C, creating threads according to the preset initial number of threads, and the threads form a thread pool.
The allocation thread calls an idle thread in the thread pool, allocates the task in the task queue to the idle thread, and the allocation thread dormancy further comprises the following steps.
In step S310C, the allocated thread looks up an idle thread in the thread pool.
Step S320C, if an idle thread exists in the thread pool, calling the idle thread, extracting a task from the task queue, distributing the task to the idle thread, and distributing thread dormancy after distribution is finished; otherwise, step S310C is executed after the thread sleep is allocated for the preset duration.
In a preferred embodiment, the thread number in the thread pool adopts a dynamic mode, and the dynamic mode is suitable for the situation that the task amount changes relatively greatly.
The step S100 further includes:
step S110D, creating threads according to the preset initial number of threads, and the threads form a thread pool.
The initial number of threads is the minimum number of threads in the thread pool.
The allocation thread calls an idle thread in the thread pool, allocates the tasks in the task queue to the idle thread, and after allocation is finished, the allocation thread dormancy further comprises the following steps.
In step S311D, the allocated thread finds an idle thread in the thread pool.
Step S312D, determining the number of created threads according to the search result and the number of tasks in the current task queue.
The method I is to compare the number of the tasks in the task queue with the number of the found idle threads, if the number of the found idle threads is small, the difference value is obtained by subtracting the number of the tasks in the task queue from the number of the idle threads, and the difference value is the number of the created threads, otherwise, the number of the created threads is 0.
The configuration also comprises the maximum thread quantity, and the thread quantity in the thread pool is greater than or equal to the minimum quantity and less than or equal to the maximum thread quantity.
Firstly, judging whether the number of the current threads in the thread pool is the maximum number of the threads, if so, the number of the created threads is 0, and if not, judging as follows.
And comparing the number of the tasks in the task queue with the number of the found idle threads, if the number of the found idle threads is less, subtracting the number of the tasks in the task queue from the number of the idle threads to obtain a difference value, wherein the difference value is the number of the threads needing to be increased, otherwise, the number of the created threads is 0.
And judging whether the sum of the number of the existing threads and the number of the threads needing to be increased is larger than or equal to the maximum number of the threads, if so, determining that the difference value between the maximum number of the threads and the number of the existing threads is the number of the created threads, otherwise, determining that the number of the threads needing to be increased is the number of the created threads.
The configuration further includes the maximum thread number, and the thread number in the thread pool is greater than or equal to the minimum number and less than or equal to the maximum thread number.
And determining the number of idle threads required in the thread pool according to the adding time of the last task sequenced in the task queue, the current time, the average number of processing tasks in the thread unit time, the number of tasks in the current task queue and a preset task waiting time threshold.
And adding the required idle thread number and the thread number occupied currently to obtain a sum value, taking the smaller value of the preset maximum thread number and the sum value, and taking the difference value of the smaller value and the thread number in the current thread pool as the number of the created threads.
The specific operation is as follows.
Firstly, judging whether the number of the current threads in the thread pool is the maximum number of the threads, if so, the number of the created threads is 0, and if not, judging as follows.
And comparing the number of the tasks in the task queue with the number of the found idle threads, wherein if the number of the found idle threads is more than or equal to the number of the tasks in the task queue, the number of the created threads is 0, otherwise, the number of the created threads is determined according to the following method.
The number of idle threads required is determined as follows.
t=t0+T-t1,
n=N/(v×t)
Wherein T0 is the adding time of the last task in the task queue, T is the preset task waiting time threshold, T1 is the current time, N is the number of idle threads required, N is the number of tasks in the current task queue, and v is the average number of processing tasks per unit time of the threads.
And adding the number of the currently occupied threads and the number of the required idle threads to obtain a sum value.
And comparing the sum value with the maximum thread number, wherein if the sum value is larger, the number of the created threads is the difference value of the subtraction between the maximum thread number and the thread number in the current thread pool, otherwise, the number of the created threads is the difference value of the subtraction between the sum value and the thread number in the current thread pool.
In step S313D, if the number is not 0, creating a thread according to the number, and adding the created thread to the thread pool, the newly created thread is idle.
Step S314D, if an idle thread exists in the thread pool, extracting the task from the task queue, distributing the task to the idle thread, and after the distribution is finished, distributing thread dormancy; otherwise, step S312D is executed after the thread sleep is allocated for the preset duration.
In a preferred embodiment, the thread pool is periodically determined whether the thread number is excessive, a certain number of threads are deleted, and resources are released to reduce resource consumption.
The method also includes periodically deleting redundant threads in the thread pool as follows.
In step S510E, the allocation thread periodically determines the number of excess threads in the thread pool.
The number of excess threads is determined in a number of ways.
Comparing the number of the tasks in the task queue with the number of the idle threads, if the number of the idle threads is large, subtracting the number of the tasks in the task queue from the number of the idle threads to obtain a difference value, wherein the difference value is the number of the redundant threads, and otherwise, the number of the redundant threads is 0.
In the second mode, firstly, whether the number of the current threads in the thread pool is the initial thread number is judged, if yes, the number of the redundant threads is 0, and if not, the following judgment is carried out.
And comparing the number of the tasks in the task queue with the number of the idle threads, if the number of the tasks is less, subtracting the number of the idle threads from the number of the tasks to obtain a difference value, wherein the difference value is the number of the threads needing to be deleted, and otherwise, the number of the redundant threads is 0.
And judging whether the difference between the number of the existing threads and the number of the threads needing to be deleted is less than or equal to the initial number of the threads, if so, determining that the difference between the number of the existing threads and the initial number of the threads is the number of redundant threads, otherwise, determining that the number of the threads needing to be deleted is the number of the redundant threads.
And determining the number of idle threads required in the thread pool according to the adding time of the last task sequenced in the task queue, the current time, the average number of processing tasks in the thread unit time, the number of tasks in the current task queue and a preset task waiting time threshold. And adding the required idle thread number and the currently occupied thread number to obtain a sum value, taking the larger value of the initial thread number and the sum value, and taking the difference value of the current thread number and the larger value in the thread pool as the redundant thread number.
For example, whether the number of current threads in the thread pool is the initial thread number is judged, if yes, the number of redundant threads is 0, and if not, the following judgment is performed.
And comparing the number of the tasks in the task queue with the number of the idle threads, wherein if the number of the idle threads is less than or equal to the number of the tasks in the task queue, the number of the redundant threads is 0, otherwise, the number of the redundant threads is determined according to the following method.
The number of idle threads required is determined as follows.
t=t0+T-t1,
n=N/(v×t)
Wherein T0 is the time of last adding task in the task queue, T is the preset task waiting time threshold, T1 is the current time, N is the number of required idle threads, N is the number of tasks in the current task queue, and v is the average number of processing tasks in thread unit time.
And adding the number of the threads occupied currently and the number of the idle threads needed to obtain a sum value, comparing the sum value with the initial thread number, wherein if the initial thread number is larger, the number of the redundant threads is the difference value of the subtraction of the current thread number and the initial thread number, and otherwise, the number of the redundant threads is the difference value of the subtraction of the current thread number and the sum value.
Step S520E, deleting idle threads according to the number of the redundant threads, and releasing resources occupied by the deleted threads.
Referring to FIG. 2, a flow diagram of an embodiment method for allocating threads to perform tasks is provided. The dynamic mode is employed in this embodiment.
Step S201, creating threads according to a preset initial number of threads, where the threads form a thread pool, and executing one thread in the thread pool, where the thread is used for task allocation.
The threads are referred to as allocation threads.
And creating a thread object and adding the thread into the thread pool. The semaphore notification is in a blocked state when the thread has no task to execute, and the state of the thread is identified as idle. When the calling thread executes the task, the state of the thread is marked as occupied, a semaphore is sent to the thread to inform the thread, the thread starts executing, the thread transmits an execution result or an exception to a task result object parameter, the state of the thread is marked as idle, and the next calling is waited. The user can obtain a return result through the result object parameters, and the result is normal execution or abnormal interruption.
The thread pool has the following functions: determining the number of tasks in the current task queue; determining the number of idle threads in a current thread pool; checking whether a task still exists in the task queue; and releasing the resources of the deleted thread.
Step S202, creating tasks, setting priorities for the created tasks, inserting the created tasks into a task queue according to the sequence of the priorities from high to low, and waking up an allocation thread to perform task allocation.
When creating a task, the task receives a multicast entrusting object and result object parameters, and the multicast entrusting object is a method comprising task operation logic. The user gets the result of the execution of the operation from the result object.
Step S203, the allocation thread searches for an idle thread in the thread pool.
And step S204, the distribution thread determines the number of the created threads according to the search result and the number of the tasks in the current task queue.
Step S205, the threads are allocated for judgment, if the number is not 0, the threads are created according to the number, the created threads are added into the thread pool, and the newly created threads are idle.
Step S206, the thread is allocated for judgment, if an idle thread exists in the thread pool, step S208 is executed, otherwise, step S207 is executed.
In step S207, the thread sleep preset duration is allocated and then step S203 is executed.
And S208, taking the head of the task queue as a starting point by the distributing thread, sequentially extracting the tasks, distributing the extracted tasks to idle threads, and after the distribution is finished, enabling the distributing thread to be dormant.
Step S209, the thread executes the task, and after the execution is finished, the execution result is given to the result object parameter, and the distribution thread is waken up.
Step S210, the distribution thread searches whether there is a task in the task queue, if yes, step S203 is executed, otherwise, step S211 is executed.
In step S211, the assigned thread sleeps.
In this embodiment, the allocation thread also periodically determines the number of redundant threads in the thread pool; and deleting idle threads according to the number of the redundant threads, and releasing resources occupied by the deleted threads.
Referring to FIG. 3, a block diagram of a system for assigning threads to perform tasks in accordance with the present invention is shown.
The system comprises:
a thread pool creation module 100 for creating a thread pool.
And the task adding module 200 is used for creating a task and adding the task into the task queue.
And the task allocation module 300 is configured to invoke an idle thread in the thread pool, and allocate a task in the task queue to the idle thread.
And a result returning module 400, configured to return an execution result to the task after the thread executes the task.
Further, the task adding module is further used for adding the result object parameters and the multicast entrusting object containing the task operation into the task when the task is created;
the result returning module is further used for endowing the execution result to the result object parameter after the thread executes the task.
Further, the task adding module is also used for setting priority for the created task after the task is created;
the task adding module is further used for adding the created tasks into the task queue according to the sequence of the priorities from high to low when the tasks are added into the task queue;
the task allocation module is further used for calling idle threads in the thread pool, sequentially extracting tasks by taking the head of the task queue as a starting point, and allocating the extracted tasks to the idle threads.
Further, the task allocation module is further configured to execute a thread in the thread pool after the thread pool creation module creates the thread pool, where the thread is used for task allocation, and the thread is called an allocation thread;
the task adding module is also used for awakening an allocation thread to perform task allocation after adding the task into the task queue;
the task allocation module is further used for calling idle threads in the thread pool through the allocation threads, allocating the tasks in the task queue to the idle threads, and enabling the allocation threads to be dormant after the allocation is finished.
Further, the thread pool creating module is further configured to create threads according to a preset initial thread number, where the threads form a thread pool;
the task allocation module is used for calling idle threads in the thread pool through the allocation threads, allocating the tasks in the task queue to the idle threads, and further searching the idle threads in the thread pool through the allocation threads when the allocation threads are dormant after the allocation is finished; if an idle thread exists in the thread pool, extracting a task from the task queue, distributing the task to the idle thread, and sleeping the distributed thread after the distribution is finished; otherwise, the thread is allocated to be dormant for a preset time length and then the search is executed.
Further, the task allocation module is further configured to determine the number of created threads according to the search result and the number of tasks in the current task queue after searching and before judging whether an idle thread exists in the thread pool; and if the number is not 0, creating the threads according to the number, adding the created threads into the thread pool, and enabling the newly created threads to be idle.
Further, the system also comprises a thread deleting module used for periodically determining the number of redundant threads in the thread pool by allocating the threads; and deleting idle threads according to the number of the redundant threads, and releasing resources occupied by the deleted threads.
The thread deleting module is used for determining the number of idle threads needed in the thread pool according to the adding time of the last task sequenced in the task queue, the current time, the average number of processing tasks in unit time of the thread, the number of tasks in the current task queue and a preset task waiting time threshold when the number of the redundant threads in the thread pool is determined by the distributed threads; and adding the required idle thread number and the currently occupied thread number to obtain a sum value, taking the larger value of the initial thread number and the sum value, and taking the difference value of the current thread number and the larger value in the thread pool as the redundant thread number.
Furthermore, the result returning module is also used for awakening the distribution thread after the thread executes the task;
the task allocation module is also used for searching whether a task exists in the task queue through the allocation thread after the allocation thread is awakened, if so, calling an idle thread in the thread pool, allocating the task in the task queue to the idle thread, and sleeping the allocation thread, otherwise, directly sleeping the allocation thread.
Further, the result returning module is further configured to, after the thread executes the task, find whether there is a task in the task queue through the thread, if there is a task in the task queue, extract a first task in the task queue, and execute the task through the thread.
Further, the task allocation module is further configured to wake up the allocation thread periodically, find whether there is a task in the task queue through the allocation thread, if there is a task in the task queue, call an idle thread in the thread pool, allocate the task in the task queue to the idle thread, and sleep the allocation thread, otherwise, directly sleep the allocation thread.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (10)
1. A method of distributing threads to perform tasks, the method comprising:
step 1, creating a thread pool;
step 2, creating a task and adding the task into a task queue;
step 3, calling idle threads in the thread pool, and distributing tasks in the task queue to the idle threads;
and 4, after the thread executes the task, returning an execution result to the task.
2. The method of allocating threads to perform tasks according to claim 1,
the creating task further comprises:
step 21, adding result object parameters and multicast entrusting objects containing task operations into the task;
the step 4 further comprises the following steps:
and step 22, after the thread executes the task, giving an execution result to a result object parameter.
3. The method of allocating threads to perform tasks according to claim 1,
after the task is created, the method further comprises the following steps:
step 31, setting priority for the created task;
the adding the task into the task queue further comprises:
step 32, adding the created tasks into a task queue according to the sequence of the priorities from high to low;
the step 3 further comprises:
and step 33, calling idle threads in the thread pool, sequentially extracting tasks by taking the head of the task queue as a starting point, and distributing the extracted tasks to the idle threads.
4. The method of allocating threads to perform tasks according to claim 1,
after the thread pool is created, the method further comprises the following steps:
step 41, executing a thread in a thread pool, where the thread is used for task allocation, and the thread is called an allocation thread;
after the task is added into the task queue, the method further comprises the following steps:
step 42, waking up the distribution thread to distribute tasks;
the step 3 further comprises:
and 43, the allocation thread calls an idle thread in the thread pool, the tasks in the task queue are allocated to the idle thread, and the allocation thread is dormant after the allocation is finished.
5. The method of assigning threads to perform tasks according to claim 4,
the step 1 further comprises:
step 51, creating threads according to a preset initial thread number, wherein the threads form a thread pool;
said step 43 further comprises:
step 52, allocating threads to search idle threads in the thread pool;
step 53, if an idle thread exists in the thread pool, calling the idle thread, extracting a task from the task queue, distributing the task to the idle thread, and distributing thread dormancy after distribution is finished; otherwise, step 52 is executed after allocating the thread sleep preset duration.
6. The method of allocating threads to perform tasks according to claim 5,
the step 52 and the step 53 further include:
step 61, determining the number of created threads according to the search result and the number of tasks in the current task queue;
and 62, if the number is not 0, creating the threads according to the number, adding the created threads into the thread pool, and enabling the newly created threads to be idle.
7. The method of allocating threads to perform tasks according to claim 6,
the method further includes periodically deleting redundant threads in the thread pool,
step 71, allocating threads to periodically determine the number of redundant threads in a thread pool;
and 72, deleting idle threads according to the number of the redundant threads, and releasing resources occupied by the deleted threads.
8. The method of allocating threads to perform tasks according to claim 7,
said step 71 further comprises:
step 81A, determining the number of idle threads needed in a thread pool according to the adding time of the last task sequenced in a task queue, the current time, the average number of processing tasks in unit time of threads, the number of tasks in the current task queue and a preset task waiting time threshold;
step 82A, adding the required idle thread number and the currently occupied thread number to obtain a sum value, taking the larger value of the initial thread number and the sum value, and taking the difference value of the current thread number and the larger value in a thread pool as the redundant thread number;
or,
the step 61 further comprises:
step 81B, determining the number of idle threads needed in the thread pool according to the adding time of the last task sequenced in the task queue, the current time, the average number of processing tasks in unit time of the thread, the number of tasks in the current task queue and a preset task waiting time threshold;
and step 82B, adding the required idle thread number and the thread number occupied currently to obtain a sum value, and taking the smaller value of the preset maximum thread number and the sum value, wherein the difference value of the smaller value and the thread number in the current thread pool is the number of the created threads.
9. The method of assigning threads to perform tasks according to claim 4,
step 43 is followed by:
step 91, after the thread executes the task, waking up the distribution thread;
step 92, the distribution thread searches whether a task exists in the task queue, if so, step 43 is executed, otherwise, the distribution thread is dormant;
or,
step 43 is followed by:
step 93, after the thread executes the task, the thread searches whether a task exists in the task queue, if so, the first task in the task queue is extracted, and the task is executed;
or,
step 43 is followed by:
step 94, the allocation thread is awakened periodically, the allocation thread searches whether there is a task in the task queue, if yes, step 43 is executed, otherwise, the allocation thread sleeps.
10. A system for distributing threads to perform tasks, the system comprising:
the thread pool creating module is used for creating a thread pool;
the task adding module is used for creating a task and adding the task into a task queue;
the task allocation module is used for calling idle threads in the thread pool and allocating tasks in the task queue to the idle threads;
and the result returning module is used for returning the execution result to the task after the thread executes the task.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011104573780A CN102591721A (en) | 2011-12-30 | 2011-12-30 | Method and system for distributing thread execution task |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2011104573780A CN102591721A (en) | 2011-12-30 | 2011-12-30 | Method and system for distributing thread execution task |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102591721A true CN102591721A (en) | 2012-07-18 |
Family
ID=46480428
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2011104573780A Pending CN102591721A (en) | 2011-12-30 | 2011-12-30 | Method and system for distributing thread execution task |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102591721A (en) |
Cited By (63)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102981901A (en) * | 2012-11-19 | 2013-03-20 | 北京思特奇信息技术股份有限公司 | Method and device for processing connection request |
CN103268247A (en) * | 2013-06-05 | 2013-08-28 | 中国电子科技集团公司第十五研究所 | Method and device for executing task and adjusting number of remaining threads in thread pool |
CN103473129A (en) * | 2013-09-18 | 2013-12-25 | 柳州市博源环科科技有限公司 | Multi-task queue scheduling system with scalable number of threads and implementation method thereof |
CN103713944A (en) * | 2013-12-13 | 2014-04-09 | 上海华为技术有限公司 | Kernel-level thread processing method, device and system |
WO2014082562A1 (en) * | 2012-11-29 | 2014-06-05 | Tencent Technology (Shenzhen) Company Limited | Method, device, and system for information processing based on distributed buses |
CN103902361A (en) * | 2014-04-04 | 2014-07-02 | 浪潮电子信息产业股份有限公司 | Thread pool capable of dynamically adjusting size |
CN104111877A (en) * | 2014-07-29 | 2014-10-22 | 广东能龙教育股份有限公司 | A thread resource dynamic allocation system and method based on a thread allocation engine |
CN104216765A (en) * | 2014-08-15 | 2014-12-17 | 东软集团股份有限公司 | Multithreading concurrent service processing method and system |
CN104423996A (en) * | 2013-09-04 | 2015-03-18 | 腾讯科技(深圳)有限公司 | View refreshing method and view refreshing device |
CN104536827A (en) * | 2015-01-27 | 2015-04-22 | 浪潮(北京)电子信息产业有限公司 | A data scheduling method and device |
CN104714785A (en) * | 2015-03-31 | 2015-06-17 | 中芯睿智(北京)微电子科技有限公司 | Task scheduling device, task scheduling method and data parallel processing device |
CN104899099A (en) * | 2015-05-26 | 2015-09-09 | 北京金和网络股份有限公司 | Task allocation method based on thread pool |
CN105119981A (en) * | 2015-07-23 | 2015-12-02 | 上海斐讯数据通信技术有限公司 | Method for processing messages |
CN105389209A (en) * | 2015-12-25 | 2016-03-09 | 中国建设银行股份有限公司 | Asynchronous batch task processing method and system |
CN105573840A (en) * | 2015-12-08 | 2016-05-11 | 东软集团股份有限公司 | Event processing method and device in workflow operating period |
CN105718315A (en) * | 2016-02-17 | 2016-06-29 | 中国农业银行股份有限公司 | Task processing method and server |
CN105743713A (en) * | 2016-04-14 | 2016-07-06 | 上海斐讯数据通信技术有限公司 | Network management system and network management method |
CN105791254A (en) * | 2014-12-26 | 2016-07-20 | 阿里巴巴集团控股有限公司 | Network request processing method, device and terminal |
CN105991669A (en) * | 2015-01-28 | 2016-10-05 | 中国移动通信集团公司 | Method and system for processing multi-modal sign data |
CN106020954A (en) * | 2016-05-13 | 2016-10-12 | 深圳市永兴元科技有限公司 | Thread management method and device |
CN106095590A (en) * | 2016-07-21 | 2016-11-09 | 联动优势科技有限公司 | A kind of method for allocating tasks based on thread pool and device |
CN106126354A (en) * | 2016-06-21 | 2016-11-16 | 中国建设银行股份有限公司 | A kind of asynchronous batch processing method and system |
CN106155796A (en) * | 2016-07-25 | 2016-11-23 | 浪潮(北京)电子信息产业有限公司 | A kind of thread scheduling method based on queue and device |
CN106201696A (en) * | 2016-07-15 | 2016-12-07 | 东软集团股份有限公司 | Method and apparatus for thread |
CN106227739A (en) * | 2016-07-13 | 2016-12-14 | 克拉玛依红有软件有限责任公司 | A kind of realize data request method based on multitask |
CN106502773A (en) * | 2016-10-09 | 2017-03-15 | 武汉斗鱼网络科技有限公司 | There is data asynchronous processing method and the module of synchronous callback information function |
CN106528065A (en) * | 2015-09-14 | 2017-03-22 | 阿里巴巴集团控股有限公司 | Thread obtaining method and device |
CN106648892A (en) * | 2016-12-12 | 2017-05-10 | 深圳市元征软件开发有限公司 | Allocation processing method and device for detection threads |
CN106648850A (en) * | 2015-11-02 | 2017-05-10 | 佳能株式会社 | Information processing apparatus and method of controlling the same |
CN106933673A (en) * | 2015-12-30 | 2017-07-07 | 阿里巴巴集团控股有限公司 | Adjust the method and device of component logic number of threads |
CN107562538A (en) * | 2017-08-22 | 2018-01-09 | 中国铁道科学研究院电子计算技术研究所 | Data pick-up multitask management process and system in railway traffic statistics |
CN107643944A (en) * | 2016-07-21 | 2018-01-30 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus of processing task |
CN107818012A (en) * | 2016-09-12 | 2018-03-20 | 阿里巴巴集团控股有限公司 | A kind of data processing method, device and electronic equipment |
CN107832146A (en) * | 2017-10-27 | 2018-03-23 | 北京计算机技术及应用研究所 | Thread pool task processing method in highly available cluster system |
CN107911484A (en) * | 2017-12-13 | 2018-04-13 | 浪潮软件股份有限公司 | A kind of method and device of Message Processing |
CN107918864A (en) * | 2017-11-23 | 2018-04-17 | 平安科技(深圳)有限公司 | Electronic insurance policy generation method, device, computer equipment and storage medium |
CN108279977A (en) * | 2017-12-29 | 2018-07-13 | 深圳市德兰明海科技有限公司 | A kind of data processing method, device and controller based on RTOS |
CN108810557A (en) * | 2017-07-10 | 2018-11-13 | 北京视联动力国际信息技术有限公司 | A kind of method for processing video frequency, device, electronic equipment and storage medium |
CN108829521A (en) * | 2018-06-13 | 2018-11-16 | 平安科技(深圳)有限公司 | Task processing method and device, computer equipment and storage medium |
CN108924128A (en) * | 2018-06-29 | 2018-11-30 | Oppo(重庆)智能科技有限公司 | A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication |
CN109271252A (en) * | 2018-08-29 | 2019-01-25 | 华为技术有限公司 | A kind of method and device adjusting Thread Count |
CN109308218A (en) * | 2018-08-22 | 2019-02-05 | 安徽慧视金瞳科技有限公司 | A kind of matching algorithm that multiple spot is drawn simultaneously |
CN109426572A (en) * | 2017-08-29 | 2019-03-05 | 杭州海康威视数字技术股份有限公司 | Task processing method, device and electronic equipment |
CN109508229A (en) * | 2018-09-19 | 2019-03-22 | 安徽慧视金瞳科技有限公司 | A kind of matching process that multiple spot is drawn simultaneously |
CN109582455A (en) * | 2018-12-03 | 2019-04-05 | 恒生电子股份有限公司 | Multithreading task processing method, device and storage medium |
CN109634724A (en) * | 2018-10-16 | 2019-04-16 | 深圳壹账通智能科技有限公司 | Collecting method, device, equipment and computer storage medium |
CN109783230A (en) * | 2018-12-17 | 2019-05-21 | 平安普惠企业管理有限公司 | Flow control methods, device, computer equipment and storage medium based on semaphore |
CN109885383A (en) * | 2018-10-30 | 2019-06-14 | 广东科学技术职业学院 | A Non-Unit Time Task Scheduling Method with Constraints |
CN110297711A (en) * | 2019-05-16 | 2019-10-01 | 平安科技(深圳)有限公司 | Batch data processing method, device, computer equipment and storage medium |
CN110489447A (en) * | 2019-07-16 | 2019-11-22 | 招联消费金融有限公司 | Data query method, apparatus, computer equipment and storage medium |
CN110851245A (en) * | 2019-09-24 | 2020-02-28 | 厦门网宿有限公司 | Distributed asynchronous task scheduling method and electronic equipment |
CN111083197A (en) * | 2019-11-20 | 2020-04-28 | 中盈优创资讯科技有限公司 | Report scheduling method and device |
CN111104210A (en) * | 2019-11-26 | 2020-05-05 | 苏宁云计算有限公司 | Task processing method and device and computer system |
CN111290842A (en) * | 2018-12-10 | 2020-06-16 | 北京京东尚科信息技术有限公司 | Task execution method and device |
CN111292735A (en) * | 2018-12-06 | 2020-06-16 | 北京嘀嘀无限科技发展有限公司 | Signal processing device, method, electronic apparatus, and computer storage medium |
CN111831422A (en) * | 2019-04-15 | 2020-10-27 | 大唐移动通信设备有限公司 | Task processing method and device |
CN112052094A (en) * | 2020-09-09 | 2020-12-08 | 浪潮卓数大数据产业发展有限公司 | Task execution method based on multiple threads |
CN112052081A (en) * | 2020-08-13 | 2020-12-08 | 烽火通信科技股份有限公司 | Task scheduling method and device and electronic equipment |
CN112287064A (en) * | 2020-12-25 | 2021-01-29 | 智道网联科技(北京)有限公司 | Rendering method and device for map engine anchor point |
CN113452554A (en) * | 2021-06-18 | 2021-09-28 | 上海艾拉比智能科技有限公司 | Online OTA differential packet making system and method based on queuing mechanism |
CN113722078A (en) * | 2021-11-02 | 2021-11-30 | 西安热工研究院有限公司 | High-concurrency database access method, system and equipment based on thread pool |
CN114217947A (en) * | 2021-11-04 | 2022-03-22 | 北京百度网讯科技有限公司 | Task execution method and device, electronic equipment and readable storage medium |
CN114721774A (en) * | 2022-04-02 | 2022-07-08 | 浙江数新网络有限公司 | Thread pool based on single-JVM (Java virtual machine) instance of response type programming stand-alone |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101001290A (en) * | 2006-01-09 | 2007-07-18 | 杭州世导科技有限公司 | System for multi-media integrated accessing |
CN101262367A (en) * | 2008-03-07 | 2008-09-10 | 中兴通讯股份有限公司 | Collection method and device for performance data |
CN101287166A (en) * | 2008-02-22 | 2008-10-15 | 北京航空航天大学 | A short message release system and release method for an electronic meeting assistance system |
CN101887367A (en) * | 2010-06-22 | 2010-11-17 | 天津大学 | A Multilevel Parallel Programming Method |
-
2011
- 2011-12-30 CN CN2011104573780A patent/CN102591721A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101001290A (en) * | 2006-01-09 | 2007-07-18 | 杭州世导科技有限公司 | System for multi-media integrated accessing |
CN101287166A (en) * | 2008-02-22 | 2008-10-15 | 北京航空航天大学 | A short message release system and release method for an electronic meeting assistance system |
CN101262367A (en) * | 2008-03-07 | 2008-09-10 | 中兴通讯股份有限公司 | Collection method and device for performance data |
CN101887367A (en) * | 2010-06-22 | 2010-11-17 | 天津大学 | A Multilevel Parallel Programming Method |
Cited By (89)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102981901A (en) * | 2012-11-19 | 2013-03-20 | 北京思特奇信息技术股份有限公司 | Method and device for processing connection request |
WO2014082562A1 (en) * | 2012-11-29 | 2014-06-05 | Tencent Technology (Shenzhen) Company Limited | Method, device, and system for information processing based on distributed buses |
CN103856440A (en) * | 2012-11-29 | 2014-06-11 | 腾讯科技(深圳)有限公司 | Message processing method, server and message processing system based on distributed bus |
CN103856440B (en) * | 2012-11-29 | 2015-11-18 | 腾讯科技(深圳)有限公司 | A kind of message treatment method based on distributed bus, server and system |
US9537786B2 (en) | 2012-11-29 | 2017-01-03 | Tencent Technology (Shenzhen) Company Limited | Method, device, and system for information processing based on distributed buses |
CN103268247A (en) * | 2013-06-05 | 2013-08-28 | 中国电子科技集团公司第十五研究所 | Method and device for executing task and adjusting number of remaining threads in thread pool |
CN103268247B (en) * | 2013-06-05 | 2017-01-18 | 中国电子科技集团公司第十五研究所 | Method and device for executing task and adjusting number of remaining threads in thread pool |
CN104423996B (en) * | 2013-09-04 | 2019-02-01 | 腾讯科技(深圳)有限公司 | View method for refreshing and device |
CN104423996A (en) * | 2013-09-04 | 2015-03-18 | 腾讯科技(深圳)有限公司 | View refreshing method and view refreshing device |
CN103473129B (en) * | 2013-09-18 | 2017-01-18 | 深圳前海大数金融服务有限公司 | Multi-task queue scheduling system with scalable number of threads and implementation method thereof |
CN103473129A (en) * | 2013-09-18 | 2013-12-25 | 柳州市博源环科科技有限公司 | Multi-task queue scheduling system with scalable number of threads and implementation method thereof |
CN103713944A (en) * | 2013-12-13 | 2014-04-09 | 上海华为技术有限公司 | Kernel-level thread processing method, device and system |
CN103713944B (en) * | 2013-12-13 | 2019-08-20 | 上海华为技术有限公司 | A kind of processing method of Kernel-level thread, device and system |
CN103902361A (en) * | 2014-04-04 | 2014-07-02 | 浪潮电子信息产业股份有限公司 | Thread pool capable of dynamically adjusting size |
CN104111877A (en) * | 2014-07-29 | 2014-10-22 | 广东能龙教育股份有限公司 | A thread resource dynamic allocation system and method based on a thread allocation engine |
CN104216765A (en) * | 2014-08-15 | 2014-12-17 | 东软集团股份有限公司 | Multithreading concurrent service processing method and system |
CN104216765B (en) * | 2014-08-15 | 2017-11-03 | 东软集团股份有限公司 | A kind of method and system of multi-thread concurrent processing business |
CN105791254A (en) * | 2014-12-26 | 2016-07-20 | 阿里巴巴集团控股有限公司 | Network request processing method, device and terminal |
CN104536827A (en) * | 2015-01-27 | 2015-04-22 | 浪潮(北京)电子信息产业有限公司 | A data scheduling method and device |
CN104536827B (en) * | 2015-01-27 | 2019-05-28 | 浪潮(北京)电子信息产业有限公司 | A kind of data dispatching method and device |
CN105991669A (en) * | 2015-01-28 | 2016-10-05 | 中国移动通信集团公司 | Method and system for processing multi-modal sign data |
CN105991669B (en) * | 2015-01-28 | 2019-03-26 | 中国移动通信集团公司 | A kind of processing method and system of multi-modal sign data |
CN104714785A (en) * | 2015-03-31 | 2015-06-17 | 中芯睿智(北京)微电子科技有限公司 | Task scheduling device, task scheduling method and data parallel processing device |
CN104899099A (en) * | 2015-05-26 | 2015-09-09 | 北京金和网络股份有限公司 | Task allocation method based on thread pool |
CN105119981A (en) * | 2015-07-23 | 2015-12-02 | 上海斐讯数据通信技术有限公司 | Method for processing messages |
CN106528065B (en) * | 2015-09-14 | 2019-11-08 | 阿里巴巴集团控股有限公司 | A kind of thread acquisition methods and equipment |
CN106528065A (en) * | 2015-09-14 | 2017-03-22 | 阿里巴巴集团控股有限公司 | Thread obtaining method and device |
CN106648850A (en) * | 2015-11-02 | 2017-05-10 | 佳能株式会社 | Information processing apparatus and method of controlling the same |
CN105573840B (en) * | 2015-12-08 | 2019-06-14 | 东软集团股份有限公司 | The event-handling method and device of work flow operation phase |
CN105573840A (en) * | 2015-12-08 | 2016-05-11 | 东软集团股份有限公司 | Event processing method and device in workflow operating period |
CN105389209A (en) * | 2015-12-25 | 2016-03-09 | 中国建设银行股份有限公司 | Asynchronous batch task processing method and system |
CN105389209B (en) * | 2015-12-25 | 2019-04-26 | 中国建设银行股份有限公司 | A kind of asynchronous batch tasks processing method and system |
CN106933673A (en) * | 2015-12-30 | 2017-07-07 | 阿里巴巴集团控股有限公司 | Adjust the method and device of component logic number of threads |
US10783005B2 (en) | 2015-12-30 | 2020-09-22 | Alibaba Group Holding Limited | Component logical threads quantity adjustment method and device |
CN105718315A (en) * | 2016-02-17 | 2016-06-29 | 中国农业银行股份有限公司 | Task processing method and server |
CN105743713A (en) * | 2016-04-14 | 2016-07-06 | 上海斐讯数据通信技术有限公司 | Network management system and network management method |
CN105743713B (en) * | 2016-04-14 | 2019-10-11 | 上海斐讯数据通信技术有限公司 | A network management system and method |
CN106020954A (en) * | 2016-05-13 | 2016-10-12 | 深圳市永兴元科技有限公司 | Thread management method and device |
CN106126354A (en) * | 2016-06-21 | 2016-11-16 | 中国建设银行股份有限公司 | A kind of asynchronous batch processing method and system |
CN106227739A (en) * | 2016-07-13 | 2016-12-14 | 克拉玛依红有软件有限责任公司 | A kind of realize data request method based on multitask |
CN106227739B (en) * | 2016-07-13 | 2020-01-21 | 克拉玛依红有软件有限责任公司 | Method for realizing data request based on multiple tasks |
CN106201696A (en) * | 2016-07-15 | 2016-12-07 | 东软集团股份有限公司 | Method and apparatus for thread |
CN107643944A (en) * | 2016-07-21 | 2018-01-30 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus of processing task |
CN106095590B (en) * | 2016-07-21 | 2019-05-03 | 联动优势科技有限公司 | A kind of method for allocating tasks and device based on thread pool |
CN106095590A (en) * | 2016-07-21 | 2016-11-09 | 联动优势科技有限公司 | A kind of method for allocating tasks based on thread pool and device |
CN106155796A (en) * | 2016-07-25 | 2016-11-23 | 浪潮(北京)电子信息产业有限公司 | A kind of thread scheduling method based on queue and device |
CN107818012A (en) * | 2016-09-12 | 2018-03-20 | 阿里巴巴集团控股有限公司 | A kind of data processing method, device and electronic equipment |
CN107818012B (en) * | 2016-09-12 | 2021-08-27 | 阿里巴巴集团控股有限公司 | Data processing method and device and electronic equipment |
CN106502773A (en) * | 2016-10-09 | 2017-03-15 | 武汉斗鱼网络科技有限公司 | There is data asynchronous processing method and the module of synchronous callback information function |
CN106648892A (en) * | 2016-12-12 | 2017-05-10 | 深圳市元征软件开发有限公司 | Allocation processing method and device for detection threads |
CN108810557A (en) * | 2017-07-10 | 2018-11-13 | 北京视联动力国际信息技术有限公司 | A kind of method for processing video frequency, device, electronic equipment and storage medium |
CN107562538B (en) * | 2017-08-22 | 2020-01-07 | 中国铁道科学研究院电子计算技术研究所 | Data extraction multitask management method and system in railway transportation statistics |
CN107562538A (en) * | 2017-08-22 | 2018-01-09 | 中国铁道科学研究院电子计算技术研究所 | Data pick-up multitask management process and system in railway traffic statistics |
CN109426572A (en) * | 2017-08-29 | 2019-03-05 | 杭州海康威视数字技术股份有限公司 | Task processing method, device and electronic equipment |
CN109426572B (en) * | 2017-08-29 | 2021-07-02 | 杭州海康威视数字技术股份有限公司 | Task processing method and device and electronic equipment |
CN107832146A (en) * | 2017-10-27 | 2018-03-23 | 北京计算机技术及应用研究所 | Thread pool task processing method in highly available cluster system |
CN107918864A (en) * | 2017-11-23 | 2018-04-17 | 平安科技(深圳)有限公司 | Electronic insurance policy generation method, device, computer equipment and storage medium |
CN107911484B (en) * | 2017-12-13 | 2020-07-07 | 浪潮软件股份有限公司 | A method and device for message processing |
CN107911484A (en) * | 2017-12-13 | 2018-04-13 | 浪潮软件股份有限公司 | A kind of method and device of Message Processing |
CN108279977B (en) * | 2017-12-29 | 2021-12-10 | 深圳市德兰明海科技有限公司 | Data processing method and device based on RTOS (real time operating System) and controller |
CN108279977A (en) * | 2017-12-29 | 2018-07-13 | 深圳市德兰明海科技有限公司 | A kind of data processing method, device and controller based on RTOS |
CN108829521A (en) * | 2018-06-13 | 2018-11-16 | 平安科技(深圳)有限公司 | Task processing method and device, computer equipment and storage medium |
CN108924128A (en) * | 2018-06-29 | 2018-11-30 | Oppo(重庆)智能科技有限公司 | A kind of mobile terminal and its method for limiting, the storage medium of interprocess communication |
CN109308218A (en) * | 2018-08-22 | 2019-02-05 | 安徽慧视金瞳科技有限公司 | A kind of matching algorithm that multiple spot is drawn simultaneously |
CN109271252A (en) * | 2018-08-29 | 2019-01-25 | 华为技术有限公司 | A kind of method and device adjusting Thread Count |
CN109508229A (en) * | 2018-09-19 | 2019-03-22 | 安徽慧视金瞳科技有限公司 | A kind of matching process that multiple spot is drawn simultaneously |
CN109634724A (en) * | 2018-10-16 | 2019-04-16 | 深圳壹账通智能科技有限公司 | Collecting method, device, equipment and computer storage medium |
CN109885383A (en) * | 2018-10-30 | 2019-06-14 | 广东科学技术职业学院 | A Non-Unit Time Task Scheduling Method with Constraints |
CN109582455B (en) * | 2018-12-03 | 2021-06-18 | 恒生电子股份有限公司 | Multithreading task processing method and device and storage medium |
CN109582455A (en) * | 2018-12-03 | 2019-04-05 | 恒生电子股份有限公司 | Multithreading task processing method, device and storage medium |
CN111292735A (en) * | 2018-12-06 | 2020-06-16 | 北京嘀嘀无限科技发展有限公司 | Signal processing device, method, electronic apparatus, and computer storage medium |
CN111290842A (en) * | 2018-12-10 | 2020-06-16 | 北京京东尚科信息技术有限公司 | Task execution method and device |
CN109783230A (en) * | 2018-12-17 | 2019-05-21 | 平安普惠企业管理有限公司 | Flow control methods, device, computer equipment and storage medium based on semaphore |
CN111831422A (en) * | 2019-04-15 | 2020-10-27 | 大唐移动通信设备有限公司 | Task processing method and device |
CN111831422B (en) * | 2019-04-15 | 2024-04-30 | 大唐移动通信设备有限公司 | Task processing method and device |
CN110297711B (en) * | 2019-05-16 | 2024-01-19 | 平安科技(深圳)有限公司 | Batch data processing method, device, computer equipment and storage medium |
CN110297711A (en) * | 2019-05-16 | 2019-10-01 | 平安科技(深圳)有限公司 | Batch data processing method, device, computer equipment and storage medium |
CN110489447A (en) * | 2019-07-16 | 2019-11-22 | 招联消费金融有限公司 | Data query method, apparatus, computer equipment and storage medium |
CN110851245A (en) * | 2019-09-24 | 2020-02-28 | 厦门网宿有限公司 | Distributed asynchronous task scheduling method and electronic equipment |
CN111083197A (en) * | 2019-11-20 | 2020-04-28 | 中盈优创资讯科技有限公司 | Report scheduling method and device |
CN111104210A (en) * | 2019-11-26 | 2020-05-05 | 苏宁云计算有限公司 | Task processing method and device and computer system |
CN112052081A (en) * | 2020-08-13 | 2020-12-08 | 烽火通信科技股份有限公司 | Task scheduling method and device and electronic equipment |
CN112052081B (en) * | 2020-08-13 | 2022-06-03 | 烽火通信科技股份有限公司 | Task scheduling method and device and electronic equipment |
CN112052094A (en) * | 2020-09-09 | 2020-12-08 | 浪潮卓数大数据产业发展有限公司 | Task execution method based on multiple threads |
CN112287064A (en) * | 2020-12-25 | 2021-01-29 | 智道网联科技(北京)有限公司 | Rendering method and device for map engine anchor point |
CN113452554A (en) * | 2021-06-18 | 2021-09-28 | 上海艾拉比智能科技有限公司 | Online OTA differential packet making system and method based on queuing mechanism |
CN113722078A (en) * | 2021-11-02 | 2021-11-30 | 西安热工研究院有限公司 | High-concurrency database access method, system and equipment based on thread pool |
CN114217947A (en) * | 2021-11-04 | 2022-03-22 | 北京百度网讯科技有限公司 | Task execution method and device, electronic equipment and readable storage medium |
CN114721774A (en) * | 2022-04-02 | 2022-07-08 | 浙江数新网络有限公司 | Thread pool based on single-JVM (Java virtual machine) instance of response type programming stand-alone |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102591721A (en) | Method and system for distributing thread execution task | |
CN101887383B (en) | Process real-time scheduling method | |
CN109582455B (en) | Multithreading task processing method and device and storage medium | |
US10467054B2 (en) | Resource management method and system, and computer storage medium | |
WO2017080273A1 (en) | Task management methods and system, and computer storage medium | |
CN105117284B (en) | Method for scheduling work threads based on priority proportion queue | |
CN108509260A (en) | Thread identifying processing method, apparatus, computer equipment and storage medium | |
CN104050137B (en) | The method and device that kernel is run in a kind of OS | |
CN105955809B (en) | Thread scheduling method and system | |
JP5347451B2 (en) | Multiprocessor system, conflict avoidance program, and conflict avoidance method | |
US20090178045A1 (en) | Scheduling Memory Usage Of A Workload | |
WO2022095862A1 (en) | Thread priority adjusting method, terminal, and computer readable storage medium | |
US20080244118A1 (en) | Method and apparatus for sharing buffers | |
CN109324891A (en) | A kind of periodic duty low-power consumption scheduling method of ratio free time distribution | |
CN101894049A (en) | System and method for recycling garbage object in self-adaptive way | |
US9839064B2 (en) | Sensor data collecting device | |
CN115509704A (en) | Task scheduling method, device, equipment and storage medium | |
CN119127417A (en) | Task processing method, task allocation method and computing device | |
US20080313652A1 (en) | Notifying user mode scheduler of blocking events | |
CN109358961B (en) | Resource scheduling method and device with storage function | |
CN104182280B (en) | Low-energy RM real-time task scheduling method for hybrid main memory embedded system | |
CN107562527B (en) | Real-time task scheduling method for SMP (symmetric multi-processing) on RTOS (remote terminal operating system) | |
CN106125901A (en) | A kind of dynamic energy-saving real-time scheduling method based on interval division | |
JP2008225641A (en) | Computer system, interrupt control method and program | |
CN115328629A (en) | Method for performing real-time embedded management by expanding UEFI (unified extensible firmware interface) firmware on bare metal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20120718 |