The Task Abstraction


As described, the task manager enables a host to insulate the CLR from both the basic unit of execution and the approach with which that unit of execution is scheduled. To achieve this abstraction, the CLR hosting API introduces the notion of a task. All communication between the CLR and host is done in terms of tasks. The host's implementation of the task manager maps the notion of a task to an underlying unit of execution such as a thread or a fiber. The task abstraction is shown conceptually in Figure 14-1.

Figure 14-1. CLR hosts map the notion of a task to an underlying scheduling primitive such as a thread or a fiber.


The task abstraction is leveraged to the full extent in SQL Server 2005 in that a task needn't be mapped to the same underlying construct every time SQL Server runs. Specifically, SQL Server 2005 maps tasks either to threads or fibers based on whether SQL Server 2005 is configured to run in fiber mode.



    Customizing the Microsoft  .NET Framework Common Language Runtime
    Customizing the Microsoft .NET Framework Common Language Runtime
    ISBN: 735619883
    EAN: N/A
    Year: 2005
    Pages: 119

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net