Claims
- 1. A method for enhanced runtime hosting, the method comprising:
identifying one or more host abstraction interfaces (HAIs) exposed by a host application, the one or more HAIs corresponding to respective execution environment abstraction(s) supported by the hosting application; during execution of runtime managed code and responsive to an action or event associated with an identified one of the respective execution environment abstractions, calling by the runtime, at least one specific interface or object corresponding to a specific one of the HAIs; and wherein the operations of identifying and calling provide a host application customizable runtime hosting environment to the hosting application.
- 2. A method as recited in claim 1, wherein the one or more execution environment abstractions correspond to management services for memory, threads/tasks, I/O completion, synchronization, runtime entry/exit notification, and/or garbage collection (GC).
- 3. A method as recited in claim 1, wherein calling further comprises requesting, by the runtime, a memory allocation through the at least one specific interface or object implemented by the host application.
- 4. A method as recited in claim 1, wherein calling further comprises:
communicating, by the runtime, a low memory notification from the OS to the host application via the at least one specific interface or object; and/or informing, by the runtime, the host application of consequences of failing a particular memory allocation via the at least one specific interface or object, and thereby allowing the host application to customize an action the runtime should take if a memory allocation must be failed.
- 5. A method as recited in claim 1, wherein calling further comprises creating, by the runtime, a new thread/task via the at least one specific interface or object implemented by the host application.
- 6. A method as recited in claim 1, wherein calling further comprises reusing or pooling, by the runtime, a runtime-implemented portion of a task via the at least one specific interface or object implemented by the host application.
- 7. A method as recited in claim 1, wherein calling further comprises notifying the host application, by the runtime via the at least one specific interface or object or pooling, that a task cannot be moved to a different physical OS thread and cannot have execution of the task blocked for a specified window of time.
- 8. A method as recited in claim 1, wherein calling further comprises:
indicating, by the runtime via the at least one specific object or interface, a callback to the host application for notifying the runtime when a task has been moved to a runnable or non-runnable state; and if the task has been moved to a non-runnable state, specifying by the runtime via the at least one specific interface or object that the task is to be rescheduled as soon as possible by the host application.
- 9. A method as recited in claim 1, wherein calling further comprises:
queuing, by the runtime via the at least one specific interface or object, a thread/task to a host application implemented thread pool; setting, by the runtime via the at least one specific interface or object, a size of the host application implemented thread pool; and/or querying, by the runtime, the host application implemented thread pool via the at least one specific interface or object.
- 10. A method as recited in claim 1, wherein calling further comprises:
providing a callback to the host application for notifying the runtime that a task has been moved to a different locale or a locale has changed for the task; and/or notifying, by the runtime via the at least one specific interface or object, the host application, that a task has been moved to a different locale or a locale has changed for the task.
- 11. A method as recited in claim 1, wherein calling further comprises delaying, by the runtime, host application abort of a task via the at least one specific interface or object.
- 12. A method as recited in claim 1, wherein calling further comprises adjusting, by the runtime via the at least one specific interface or object, priority of a task.
- 13. A method as recited in claim 1, wherein calling further comprises notifying the host application by the runtime via the at least one specific interface or object that a task/thread is to leave the runtime into unmanaged code.
- 14. A method as recited in claim 1, wherein calling further comprises notifying the host application by the runtime via the at least one specific interface or object that a task/thread is to reverse-leave the runtime into unmanaged code.
- 15. A method as recited in claim 1, wherein calling further comprises notifying the host application by the runtime via the at least one specific interface or object that a task/thread is to enter the runtime from unmanaged code.
- 16. A method as recited in claim 1, wherein calling further comprises notifying the host application by the runtime via the at least one specific interface or object that a task/thread is to reverse-enter the runtime from unmanaged code.
- 17. A method as recited in claim 1, wherein calling further comprises specifying by the runtime via the at least one specific interface or object a maximum number of threads/tasks that will be available to service requests on one or more I/O completion ports.
- 18. A method as recited in claim 1, wherein calling further comprises binding, by the runtime via the at least one specific interface or object, a handle to an I/O completion port or the host application.
- 19. A method as recited in claim 1, wherein calling further comprises supplying a runtime implemented callback to the host application, the runtime implemented callback to be invoked by the host application when an asynchronous I/O operation completes.
- 20. A method as recited in claim 1, wherein calling further comprises:
supplying a runtime implemented callback to the host application, the runtime implemented callback to be invoked by the host application when an asynchronous I/O operation completes; and wherein supplying allows the host application to insert custom data at the end of a structure passed by the host application to the runtime implemented callback, the custom data providing state information.
- 21. A method as recited in claim 1:wherein calling further comprises generating a task via the at least one specific interface or object; and wherein the method further comprises creating, by the runtime via the at least one specific object or interface, one or more synchronization objects for the task to substantially ensure host application knowledge of a lock on the task, the one or more synchronization objects comprising a critical section, a manual and/or auto-reset event, a semaphore, a reader/writer lock, and/or a task monitor.
- 22. A method as recited in claim 1, further comprising notifying the host application, by the runtime, of one or more runtime interfaces exposed by the runtime, the runtime interfaces allowing the host to notify the runtime of certain events and/or to obtain additional information at during process execution.
- 23. A computer-readable medium for enhanced runtime hosting, the computer-readable medium comprising computer-program executable instructions executable by a processor for:
requesting, by a runtime, a host application to identify any execution environment abstraction(s) supported by the hosting application; responsive to requesting, receiving one or more host abstraction interfaces (HAIs); and during execution of runtime managed code, calling by the runtime, at least one specific interface or object corresponding to a specific one of the HAIs.
- 24. A computer-readable medium recited in claim 23, wherein the one or more execution environment abstractions correspond to host-implemented memory, thread/task, I/O completion, synchronization, event notification, and/or garbage collection (GC) functionality.
- 25. A computer-readable medium recited in claim 23, wherein the computer-program instructions for determining further comprise instructions for communicating, by the runtime, an interface identifier (IID) to the hosting application, the IID corresponding to an abstraction specific interface.
- 26. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for communicating, by the runtime, a low memory notification from the OS to the host application via the at least one specific interface or object.
- 27. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for informing, by the runtime, the host application of consequences of failing a particular memory allocation via the at least one specific interface or object, and thereby allowing the host application to customize an action the runtime should take if a memory allocation must be failed.
- 28. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for creating, by the runtime, a new thread/task via the at least one specific interface or object implemented by the host application.
- 29. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for reusing or pooling, by the runtime, a runtime-implemented portion of a task via the at least one specific interface or object implemented by the host application.
- 30. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for notifying the host application, by the runtime via the at least one specific interface or object or pooling, that a task cannot be moved to a different physical OS thread and cannot have execution of the task blocked for a specified window of time.
- 31. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for:
indicating, by the runtime via the at least one specific object or interface, a callback to the host application for notifying the runtime when a task has been moved to a runnable or non-runnable state; and if the task has been moved to a non-runnable state, specifying by the runtime via the at least one specific interface or object that the task is to be rescheduled as soon as possible by the host application.
- 32. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for:
queuing, by the runtime via the at least one specific interface or object, a thread/task to a host application implemented thread pool; setting, by the runtime via the at least one specific interface or object, a size of the host application implemented thread pool; and/or querying, by the runtime, the host application implemented thread pool via the at least one specific interface or object.
- 33. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for providing a callback to the host application for notifying the runtime that a task has been moved to a different locale.
- 34. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for notifying, by the runtime via the at least one specific interface or object, the host application, that a task has been moved to a different locale.
- 35. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for delaying, by the runtime, host application abort of a task via the at least one specific interface or object.
- 36. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for adjusting, by the runtime via the at least one specific interface or object, priority of a task.
- 37. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for notifying the host application by the runtime via the at least one specific interface or object that a task/thread is to leave the runtime into unmanaged code.
- 38. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for notifying the host application by the runtime via the at least one specific interface or object that a task/thread is to reverse-leave the runtime into unmanaged code.
- 39. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for notifying the host application by the runtime via the at least one specific interface or object that a task/thread is to enter the runtime from unmanaged code.
- 40. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for notifying the host application by the runtime via the at least one specific interface or object that a task/thread is to reverse-enter the runtime from unmanaged code.
- 41. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for specifying by the runtime via the at least one specific interface or object a maximum number of threads/tasks that will be available to service requests on one or more I/O completion ports.
- 42. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for binding, by the runtime via the at least one specific interface or object, a handle to an I/O completion port or the host application.
- 43. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for supplying a runtime implemented callback to the host application, the runtime implemented callback to be invoked by the host application when an asynchronous I/O operation completes.
- 44. A computer-readable medium recited in claim 23, wherein the computer-program instructions for calling further comprise instructions for:
supplying a runtime implemented callback to the host application, the runtime implemented callback to be invoked by the host application when an asynchronous I/O operation completes; and wherein supplying allows the host application to insert custom data at the end of a structure passed by the host application to the runtime implemented callback, the custom data providing state information.
- 45. A computer-readable medium recited in claim 23:wherein the computer-program instructions for calling further comprise instructions for generating a task via the at least one specific interface or object; and wherein the computer-program instructions further comprise instructions for creating, by the runtime via the at least one specific object or interface, one or more synchronization objects for the task to substantially ensure host application knowledge of a lock on the task, the one or more synchronization objects comprising a critical section, a manual and/or auto-reset event, a semaphore, a reader/writer lock, and/or a task monitor.
- 46. A computer-readable medium recited in claim 23, further comprising computer-program instructions for notifying the host application, by the runtime, of one or more runtime interfaces exposed by the runtime, the runtime interfaces allowing the host to notify the runtime of certain events and/or to obtain additional information at during process execution.
- 47. A computing device for enhanced runtime hosting, the computing device comprising a processor coupled to the computer-readable medium of claim 23, the processor being configured to execute the computer-program instructions stored on the computer-readable medium.
- 48. A computing device for enhanced runtime hosting, the computing device comprising:
a processor; a memory coupled to the processor, the memory comprising computer-program instructions executable by the processor, the computer-program instructions for:
identifying one or more host abstraction interfaces (HAIs) exposed by a host application, the one or more HAIs corresponding to respective execution environment abstraction(s) supported by the hosting application; during execution of runtime managed code and responsive to an action or event associated with an identified one of the respective execution environment abstractions, calling by the runtime, at least one specific interface or object corresponding to a specific one of the HAIs; and wherein the one or more execution environment abstractions correspond to management services for memory, threads/tasks, I/O completion, synchronization, runtime entry/exit notification, and/or garbage collection (GC).
- 49. A computing device as recited in claim 48, wherein the computer-program instructions for calling further comprise instructions for informing, by the runtime, the host application of consequences of failing a particular memory allocation via the at least one specific interface or object, and thereby allowing the host application to customize an action the runtime should take if a memory allocation must be failed.
- 50. A computing device as recited in claim 48, wherein the computer-program instructions for calling further comprise instructions for creating, by the runtime, a new thread/task via the at least one specific interface or object implemented by the host application.
- 51. A computing device as recited in claim 48, wherein the computer-program instructions for calling further comprise instructions for reusing or pooling, by the runtime, a runtime-implemented portion of a task via the at least one specific interface or object implemented by the host application.
- 52. A computing device as recited in claim 48, wherein the computer-program instructions for calling further comprise instructions for notifying the host application, by the runtime via the at least one specific interface or object or pooling, that a task cannot be moved to a different physical OS thread and cannot have execution of the task blocked for a specified window of time.
- 53. A computing device as recited in claim 48, wherein the computer-program instructions for calling further comprise instructions for:
queuing, by the runtime via the at least one specific interface or object, a thread/task to a host application implemented thread pool; setting, by the runtime via the at least one specific interface or object, a size of the host application implemented thread pool; and/or querying, by the runtime, the host application implemented thread pool via the at least one specific interface or object.
- 54. A computing device as recited in claim 48, wherein the computer-program instructions for calling further comprise instructions for:
delaying, by the runtime, host application abort of a task via the at least one specific interface or object; and adjusting, by the runtime via the at least one specific interface or object, priority of a task.
- 55. A computing device as recited in claim 48, wherein the computer-program instructions for calling further comprise instructions for:
notifying the host application by the runtime via the at least one specific interface or object that a task/thread is to leave the runtime into unmanaged code; and notifying the host application by the runtime via the at least one specific interface or object that a task/thread is to reverse-leave the runtime into unmanaged code.
- 56. A computing device as recited in claim 48, wherein the computer-program instructions for calling further comprise instructions for:
notifying the host application by the runtime via the at least one specific interface or object that a task/thread is to enter the runtime from unmanaged code; and notifying the host application by the runtime via the at least one specific interface or object that a task/thread is to reverse-enter the runtime from unmanaged code.
- 57. A computing device as recited in claim 48, wherein the computer-program instructions for calling further comprise instructions for:
binding, by the runtime via the at least one specific interface or object, a handle to an I/O completion port or the host application; and specifying by the runtime via the at least one specific interface or object a maximum number of threads/tasks that will be available to service requests on one or more I/O completion ports.
- 58. A computing device as recited in claim 48, wherein the computer-program instructions for calling further comprise instructions for:
supplying a runtime implemented callback to the host application, the runtime implemented callback to be invoked by the host application when an asynchronous I/O operation completes; and wherein the instructions for supplying allow the host application to insert custom data at the end of a structure passed by the host application to the runtime implemented callback, the custom data providing state information.
- 59. A computing device as recited in claim 48, wherein the computer-program instructions for calling further comprise instructions for generating a task via the at least one specific interface or object, and wherein the method further comprises creating, by the runtime via the at least one specific object or interface, one or more synchronization objects for task to substantially ensure host application knowledge of a lock of an OS thread, the one or more synchronization objects comprising a critical section, a manual and/or auto-reset event, a semaphore, a reader/writer lock, and/or a task monitor.
- 60. A software architecture for enhanced runtime hosting, the software architecture comprising:
an application; and a runtime, the application being configured to host the runtime; wherein the runtime exposes a runtime application program interface (RI), the RI allowing the application to indicate a host abstraction interface (HAI) to the runtime, the HAI identifying application abstracted execution environment functionality; and wherein the runtime is further configured to direct actions and/or events during process execution back to the application for implementation of the application abstracted execution environment functionality via one or more portions of the HAI.
RELATED APPLICATIONS
[0001] This application is related to U.S. patent application Ser. No. 09/598,105, titled “METHOD AND SYSTEM FOR COMPILING MULTIPLE LANGUAGES”, filed on Jun. 21, 2000 commonly assigned hereto, and hereby incorporated by reference.