摘要 |
A method for managing a thread group of a process is provided. First, a group scheduling module is used to receive an execution permission request from a first thread. When detecting that a second thread in the thread group is under execution, the group scheduling module stops the first thread, and does not assign the execution permission to the first thread until the second thread is completed, and till then, the first thread retrieves a required shared resource and executes the computations. Then, the first thread releases the shared resource when completing the computations. Then, the group scheduling module retrieves a third thread with the highest priority in a waiting queue and repeats the above process until all the threads are completed. Through this method, when one thread executes a call back function, the other threads are prevented from taking this chance to use the resource required by the thread.
|