Skip to main content

TaskCompletionSource: bridging older async patterns

In this chapter

  • TaskCompletionSource: bridging older async patterns
    • Scenario: converting an event into a Task
    • Including failure and cancellation paths
  • Performance optimization: ValueTask vs. Task
    • Scenario: cache lookups
    • Usage constraints of ValueTask
  • Task.Yield: creating an async boundary
    • Scenario: keeping a method from running synchronously end to end
  • Going deeper into ExecutionContext and TaskScheduler
  • Thread pool starvation
  • Conclusion

This chapter is not available in the free preview. Purchase the book to read the complete edition now.

Buy this book