Techniques for switching threads within routines
First Claim
1. A computer-readable medium having computer-executable instructions for causing a computer to perform steps comprising:
- receiving a request from an originating routine to execute a coroutine;
executing the coroutine on an initial thread;
receiving a response back from the coroutine when the coroutine returns based upon a return statement; and
executing the coroutine a subsequent time on a subsequent thread that was indicated by the coroutine upon return.
2 Assignments
0 Petitions
Accused Products
Abstract
Various technologies and techniques are disclosed for switching threads within routines. A controller routine receives a request from an originating routine to execute a coroutine, and executes the coroutine on an initial thread. The controller routine receives a response back from the coroutine when the coroutine exits based upon a return statement. Upon return, the coroutine indicates a subsequent thread that the coroutine should be executed on when the coroutine is executed a subsequent time. The controller routine executes the coroutine the subsequent time on the subsequent thread. The coroutine picks up execution at a line of code following the return statement. Multiple return statements can be included in the coroutine, and the threads can be switched multiple times using this same approach. Graphical user interface logic and worker thread logic can be co-mingled into a single routine.
-
Citations
20 Claims
-
1. A computer-readable medium having computer-executable instructions for causing a computer to perform steps comprising:
-
receiving a request from an originating routine to execute a coroutine; executing the coroutine on an initial thread; receiving a response back from the coroutine when the coroutine returns based upon a return statement; and executing the coroutine a subsequent time on a subsequent thread that was indicated by the coroutine upon return. - View Dependent Claims (2, 3, 4)
-
-
5. A method for switching threads partially through a routine comprising the steps of:
-
starting an execution of a routine on a first thread; exiting the routine at a point partially through the routine due to a first return statement, with the first return statement having a subsequent thread identifier; resuming code execution of the routine on a subsequent thread specified in the subsequent thread identifier; and picking up code execution in the routine at a line of code following the first return statement. - View Dependent Claims (6, 7, 8, 9, 10, 11, 12, 13)
-
-
14. A method for co-mingling graphical user interface logic and worker thread logic in a single routine comprising the steps of:
-
starting code execution of initial logic contained in a coroutine, the initial logic being executed on a first thread to receive user input; receiving the user input; exiting the coroutine partially through to switch to a second thread, the second thread being a different thread than the first thread; and resuming code execution in the coroutine on the second thread to perform work in response to the user input. - View Dependent Claims (15, 16, 17, 18, 19, 20)
-
Specification