Method and system for scheduling threads and handling exceptions within a multiprocessor data processing system
First Claim
1. A method, within a multiprocessor data processing system including a plurality of processors, for handling exceptions generated by said plurality of processors, wherein said multiprocessor data processing system has a global queue of multiple threads from which threads are dispatched for execution by said plurality of processors and a plurality of local dispatch flags, wherein each of said plurality of local dispatch flags is a storage location allocated to a respective one of said plurality of processors, said method comprising:
- in response to an occurrence of an exception arising from execution of a particular thread by a particular processor among said plurality of processors, saving a state of said particular thread, wherein said state of said particular thread is at least partially defined by volatile data within said particular processor that is associated with said particular thread;
executing a selected exception handler associated with said exception;
determining whether or not resumption of said particular thread depends upon an occurrence of a specified event other than completion of said selected exception handler;
in response to said determination that resumption of said particular thread depends upon an occurrence of said specified event, setting a particular local dispatch flag among said plurality of local dispatch flags that is allocated to said particular processor;
in response to said particular local dispatch flag associated with said particular processor not being set, resuming execution of said particular thread on said particular processor following execution of said selected exception handler;
in response to said particular local dispatch flag being set, dispatching a thread from said global queue for execution by said particular processor following execution of said selected exception handler; and
in response to dispatching a thread for execution by said particular processor, clearing said particular local dispatch flag associated with said particular processor regardless of whether said thread dispatched from said global queue is said particular thread.
0 Assignments
0 Petitions
Accused Products
Abstract
A method and system are disclosed for handling exceptions generated by a particular processor among a number of processors within a multiprocessor data processing system. The data processing system includes a global queue from which threads are dispatched in a priority order for execution by the processors and a number of local dispatch flags, which are each associated with one of the processors. In response to an occurrence of an exception during execution of a particular thread by a particular processor, a state of the particular thread, which is at least partially defined by volatile data within the particular processor, is saved. A selected exception handler associated with the exception is then executed. Next, a determination is made whether resumption of the particular thread depends upon an occurrence of a specified event. In response to determining that resumption of the particular thread depends upon an occurrence of the specified event, the local dispatch flag associated with the particular processor is set. Thereafter, a determination is made whether the particular thread can be interrupted by another thread. In response to the local dispatch flag associated with the particular processor not being set or in response to determining that the particular thread cannot be interrupted by another thread, the particular thread is resumed. In response to the local dispatch flag associated with the particular processor being set and a determination that the particular thread can be interrupted by another thread, a thread is selected from the global queue for execution by the particular processor.
90 Citations
12 Claims
-
1. A method, within a multiprocessor data processing system including a plurality of processors, for handling exceptions generated by said plurality of processors, wherein said multiprocessor data processing system has a global queue of multiple threads from which threads are dispatched for execution by said plurality of processors and a plurality of local dispatch flags, wherein each of said plurality of local dispatch flags is a storage location allocated to a respective one of said plurality of processors, said method comprising:
-
in response to an occurrence of an exception arising from execution of a particular thread by a particular processor among said plurality of processors, saving a state of said particular thread, wherein said state of said particular thread is at least partially defined by volatile data within said particular processor that is associated with said particular thread; executing a selected exception handler associated with said exception; determining whether or not resumption of said particular thread depends upon an occurrence of a specified event other than completion of said selected exception handler; in response to said determination that resumption of said particular thread depends upon an occurrence of said specified event, setting a particular local dispatch flag among said plurality of local dispatch flags that is allocated to said particular processor; in response to said particular local dispatch flag associated with said particular processor not being set, resuming execution of said particular thread on said particular processor following execution of said selected exception handler; in response to said particular local dispatch flag being set, dispatching a thread from said global queue for execution by said particular processor following execution of said selected exception handler; and in response to dispatching a thread for execution by said particular processor, clearing said particular local dispatch flag associated with said particular processor regardless of whether said thread dispatched from said global queue is said particular thread. - View Dependent Claims (2, 3, 4, 5, 11)
-
-
6. A multiprocessor data processing system, comprising:
-
a plurality of processors for executing threads, wherein in response to an occurrence of an exception arising from execution of a particular thread by a particular processor among said plurality of processors, a state of said particular thread that is at least partially defined by volatile data within said particular processor is saved, and wherein at least one of said plurality of processors executes a selected exception handler associated with said exception in response to said occurrence of said exception; a global queue from which threads are dispatched to selected processors among said plurality of processors for execution; a plurality of local dispatch flags, each of said plurality of local dispatch flags being a storage location allocated to a respective one of said plurality of processors, wherein a particular local dispatch flag among said plurality of local dispatch flags that is allocated to said particular processor is set in response to a determination that resumption of said particular thread depends upon an occurrence of a specified event, said specified event being an event other than completion of said selected exception handler; means for resuming execution of said particular thread on said particular processor following execution of said selected exception handler if said particular local dispatch flag is not set; means for dispatching a thread from said global queue for execution by said particular processor following execution of said selected exception handler if said particular local dispatch flag is set; and means for clearing said particular local dispatch flag in response to dispatching a thread for execution by said particular processor regardless of whether said thread dispatched from said global queue is said particular thread. - View Dependent Claims (7, 8, 9, 10, 12)
-
Specification