Giter VIP home page Giter VIP logo

Comments (3)

ryanfrancesconi avatar ryanfrancesconi commented on July 20, 2024

i remember us talking about that at some point when i was wondering if you could use it inside a function. Didn't we decide the safe way was to wrap the wrapper var in a struct?

from otatomics.

orchetect avatar orchetect commented on July 20, 2024

It's mostly a paradigm shift - the concurrent code should do all its mutation externally, finish up, and return the final result synchronously within the method. But nothing should be concurrently mutating a local variable declared within the function.

A property wrapper is already wrapping the value, so adding more layers of wrapping won't really improve the situation. On the whole, there is no safe way to mutate a local var concurrently.

from otatomics.

orchetect avatar orchetect commented on July 20, 2024

That's where something like the operations library I've worked on come in handy (OTOperations, based on NSOperation). You can wrap concurrent work in a BasicOperation and execute it synchronously within a method if you choose.

And there's a host of other API that do similar things in the standard lib or otherwise. Again, just a paradigm shift.

from otatomics.

Related Issues (2)

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.