TECHNIQUES FOR SWITCHING THREADS WITHIN ROUTINES
First Claim
1. A method comprising:
- executing an initial portion of a routine on an initial thread;
identifying a subsequent thread different than the initial thread;
processing a statement to temporarily exit the routine at an end point of the initial portion; and
performing a subsequent execution of the routine on a subsequent thread, the subsequent execution executing a subsequent portion of the routine from the end point of the initial portion.
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 method comprising:
-
executing an initial portion of a routine on an initial thread; identifying a subsequent thread different than the initial thread; processing a statement to temporarily exit the routine at an end point of the initial portion; and performing a subsequent execution of the routine on a subsequent thread, the subsequent execution executing a subsequent portion of the routine from the end point of the initial portion. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A computer-readable storage medium storing instructions executable by a computing device to cause the computing device to perform operations comprising:
-
processing an initial portion of a routine on a first thread; exiting the routine at an end point of the initial portion; and performing a subsequent processing of the routine from the end point on a subsequent thread different than the first thread. - View Dependent Claims (10, 11, 12, 13, 14)
-
-
15. A system, comprising at least one processor coupled to at least one computer-readable storage medium storing instructions executable by the at least one processor to implement:
-
executing code corresponding to an initial portion of a routine on a first thread; and switching from an execution of the initial portion of the routine on the first thread to a subsequent execution of a subsequent portion of the routine on a second thread, the first thread different than the second thread. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification