Concurrent exception handling using an aggregated exception structure
AssigneeMicrosoft Corporation
InventorsJohn Joseph Duffy, David Callahan, David Detlefs, Vance Morrison, Brian Grunkemeyer, Eric Dean Tribble
Life of this patent
Estimating the term…
Abstract
Various technologies and techniques are disclosed for providing concurrent exception handling. Exceptions that occur in concurrent workers are caught. The caught exceptions are then forwarded from the concurrent workers to a coordination worker. The caught exceptions are finally aggregated into an aggregation structure, such as an aggregate exception object. This aggregation structure is rethrown and the individual caught exceptions may then be handled at a proper time.
Claims17
A computer storage medium having computer-executable instructions for causing a computer to perform steps comprising:
- catching exceptions that occur in concurrent worker tasks of a program;
- forwarding the caught exceptions from the concurrent worker tasks to a coordination task;
- aggregating the caught exceptions into an aggregation structure;
- and
- rethrowing the aggregation structure from the coordination task so that the caught exceptions can be handled by the program at a proper time,
- wherein the caught exceptions are aggregated into the aggregation structure if an unhandled exception occurs on one of the concurrent worker tasks, and
- wherein the proper time for aggregating and rethrowing the caught exceptions in the aggregation structure is when all of the concurrent worker tasks finish executing.
A method for aggregating many exceptions into a single aggregate exception object comprising the steps of:
- catching exceptions that occur in concurrent worker tasks of a program;
- forwarding the caught exceptions from the concurrent worker tasks to a coordination task;
- aggregating the caught exceptions into a single aggregate exception object;
- and
- rethrowing the single aggregate exception object from the coordination task so that the caught exceptions can be handled by the program at a proper time,
- wherein the caught exceptions are aggregated into the single aggregate exception object if an unhandled exception occurs on one of the concurrent worker tasks, and
- wherein the proper time for aggregating and rethrowing the caught exceptions in the single aggregate exception object is when all of the concurrent worker tasks finish executing.
A method for terminating concurrent worker tasks after a first concurrent exception occurs comprising the steps of:
- providing a coordination task that initializes a shared flag and a shared location;
- starting concurrent worker tasks;
- as soon as a first concurrent exception is thrown, setting the shared flag and logging the exception to the shared location;
- when each respective concurrent worker task subsequently polls the shared flag to see if the shared flag was set, the respective task voluntarily terminates;
- if any further exceptions occur before each respective task terminates, logging those further exceptions to the shared location;
- waiting for all of the concurrent worker tasks to terminate;
- and
- creating an aggregate exception object out of any exceptions logged to the shared location and then throwing the aggregate exception object for proper handling.
Dependencies are inferred from the claim text.