Giter Site home page Giter Site logo

ivankamenev / concurrencyrecipes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattmassicotte/concurrencyrecipes

0.0 0.0 0.0 106 KB

Practical solutions to problems with Swift Concurrency

License: BSD 3-Clause "New" or "Revised" License

Swift 100.00%

concurrencyrecipes's Introduction

ConcurrencyRecipes

Practical solutions to problems with Swift Concurrency

Swift Concurrency can be really hard to use. I thought it could be handy to document and share solutions and hazards you might face along the way. I am absolutely not saying this is comprehensive, or that the solutions presented are great. I'm learning too. Contributions are very welcome, especially for problems!

Table of Contents

Hazards

Quick definitions for the hazards referenced throughout the recipes:

  • Timing: More than one option is available, but can affect when events actually occur.
  • Ordering: Unstructured tasks means ordering is up to the caller. Think carefully about dependencies, multiple invocations, and cancellation.
  • Lack of Caller Control: definitions always control actor context. This is different from other threading models, and you cannot alter definitions you do not control.
  • Sendability: types that cross isolation domains must be sendable. This isn't always easy, and for types you do not control, not possible.
  • Blocking: Swift concurrency uses a fixed-size thread pool. Tying up background threads can lead to lag and even deadlock.
  • Availability: Concurrency is evolving rapidly, and some APIs require the latest SDK.
  • Async virality: Making a function async affects all its callsites. This can result in a large number of changes, each of which could, itself, affect subsequence callsites.
  • Actor Reentrancy: More than one thread can enter an Actor's async methods. An actor's state can change across awaits.

Contributing and Collaboration

I'd love to hear from you! Get in touch via mastodon, an issue, or a pull request.

I prefer collaboration, and would love to find ways to work together if you have a similar project.

By participating in this project you agree to abide by the Contributor Code of Conduct.

concurrencyrecipes's People

Contributors

mattmassicotte avatar mcnight avatar bdewey avatar esnssr avatar jason-abbott avatar samalone avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.