US2019265956A1PendingUtilityA1

Compiler-Generated Asynchronous Enumerable Object

Assignee: MICROSOFT TECHNOLOGY LICENSING LLCPriority: Feb 28, 2018Filed: Feb 28, 2018Published: Aug 29, 2019
Est. expiryFeb 28, 2038(~11.6 yrs left)· nominal 20-yr term from priority
G06F 8/458G06F 8/443G06F 8/427G06F 8/4441G06F 8/41
54
PatentIndex Score
0
Cited by
0
References
0
Claims

Abstract

An asynchronous method is implemented in a manner that reduces the amount of runtime overhead needed to execute the asynchronous method. The data elements needed to suspend an asynchronous method to await completion of an asynchronous operation, to resume the asynchronous method at a resumption point, and to provide a completion status of the caller of the asynchronous method are consolidated into one or two reusable objects. An asynchronous method may be associated with a distinct object pool of reusable objects. The size of a pool and the total size of all pools can be configured statically or dynamically based on runtime conditions.

Claims

exact text as granted — not AI-modified
What is claimed: 
     
         1 . A system, comprising:
 at least one processor and a memory;   a program including at least one asynchronous method, the asynchronous method configured to suspend execution in order to await completion of an asynchronous operation;   at least one object pool associated with the at least one asynchronous method, the at least one object pool including one or more reusable objects, the at least one object pool associated with a non-garbage-collected heap; and   executable code including instructions that when executed on the at least one processor performs actions that:
 consolidate state data needed to resume execution of a suspended asynchronous method at a resumption point upon completion of an asynchronous operation; 
 store the state data in a select reusable object from the object pool; and 
 suspend execution of the asynchronous method to await completion of the asynchronous operation. 
   
     
     
         2 . The system of  claim 1 , wherein the executable code includes further instructions that when executed on the at least one processor performs actions that:
 resume execution of the asynchronous method from the resumption point; and   return the select reusable object to the at least one object pool.   
     
     
         3 . The system of  claim 1 , further comprising a compiler that detects an await expression in the asynchronous method and transforms the await expression into the executable code. 
     
     
         4 . The system of  claim 1 , wherein the executable code includes further instructions that when executed on the at least one processor performs actions that:
 perform the consolidation of the state data when the asynchronous method awaits completion of an asynchronous operation a first time.   
     
     
         5 . The system of  claim 1 , further comprising an object pool manager that sets a cumulative limit to a number of reusable objects in all object pools used in the program. 
     
     
         6 . The system of  claim 1 , further comprising an object pool manager that sets a size of the at least one object pool based on previous executions of the program. 
     
     
         7 . The system of  claim 1 , further comprising an object pool manager that dynamically alters a size of the at least one object pool based on memory usage during execution of the program. 
     
     
         8 . A method implemented on a computing device having at least one processor and a memory, the method comprising:
 obtaining a reusable object from an object pool, the reusable object previously allocated at runtime from a non-garbage-collected heap portion of the memory;   consolidating state data needed to resume execution of a suspended asynchronous method into the reusable object, the asynchronous method configured to await completion of an asynchronous operation;   suspending execution of the asynchronous method until completion of the asynchronous operation and releasing execution control back to a caller of the asynchronous method.   
     
     
         9 . The method of  claim 8 , further comprising:
 upon completion of the asynchronous operation:
 restoring the state data from the reusable object; 
 releasing the reusable object back to the object pool; and 
 resuming execution of the asynchronous method at the resumption point. 
   
     
     
         10 . The method of  claim 8 , further comprising:
 associating the asynchronous method with a select object pool.   
     
     
         11 . The method of  claim 8 , wherein obtaining a reusable object from the object pool further comprises:
 in the event the object pool does not have an available reusable object, allocating a reusable object.   
     
     
         12 . The method of  claim 8 , wherein obtaining a reusable object from the object pool further comprises:
 in the event the object pool does not have an available reusable object, awaiting return of an available reusable object.   
     
     
         13 . The method of  claim 8 , wherein obtaining a reusable object from the object pool further comprises:
 setting a limit of a number of reusable objects in the object pool based on previous executions of the program.   
     
     
         14 . The method of  claim 8 , wherein obtaining a reusable object from the object pool further comprises:
 dynamically increasing a number of reusable objects in the object pool based on current runtime conditions.   
     
     
         15 . A computing device, comprising:
 at least one processor communicatively coupled to a memory; and   wherein the at least one processor is configured to:
 maintain one or more reusable objects in an object pool, a reusable object previously allocated at runtime by a first asynchronous method that was suspended to await completion of a first asynchronous operation; 
 determine that a second asynchronous method needs to be suspended to await completion of a second asynchronous operation; 
 consolidate state data needed to resume execution of the second asynchronous method upon completion of the second asynchronous operation into a select one of the one or more reusable objects; 
 suspend execution of the second asynchronous method and return execution control back to a caller of the asynchronous method; 
 upon completion of the second asynchronous operation, restore the state data at the resumption point, release the select reusable object back to the object pool, and resume execution of the asynchronous method at the resumption point. 
   
     
     
         16 . The computing device of  claim 15 , wherein the at least one processor is futher configured to:
 set a limit on a number of reusable objects in all object pools used in the program.   
     
     
         17 . The computing device of  claim 15 , wherein the at least one processor is further configured to:
 dynamically increase a number of reusable objects in the object pool based on runtime conditions.   
     
     
         18 . The computing device of  claim 15 , wherein the at least one processor is configured to:
 set a limit of a number of reusable objects in the object pool based on one or more previous executions of the program.   
     
     
         19 . The computing device of  claim 15 , wherein the at least one processor is configured to:
 in the event the object pool does not have a reusable object readily available, configure a callback to provide a notification when a reusable object is available.   
     
     
         20 . The computing device of  claim 15 , wherein the at least one processor is configured to:
 in the event the object pool does not have a readily available reusable object, allocate a reusable object.

Join the waitlist — get patent alerts

Track US2019265956A1 — get alerts on status changes and closely related new filings.

We store only your email — no account needed. See our privacy policy.