16 Sharing resources between timelines

Image

In this chapter

  • Learn how to diagnose bugs due to sharing resources.
  • Understand how to create a resource-sharing primitive that can allow resources to be shared safely.

In the last chapter, we learned about timelines and how to reduce the number of resources they share. Timelines that don’t share any resources are ideal, but sometimes you need to share resources. In that case, you need to make sure they share them in a safe way. In this chapter, we will see how we can create reusable pieces of code called concurrency primitives that will let us share resources.

Principles of working with timelines

Here ...

Get Grokking Simplicity now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.