Code Monkey home page Code Monkey logo

Comments (12)

radianttap avatar radianttap commented on June 2, 2024 1

I also tested this in two largest projects I have, which are both using Operations for networking and data storage. TSan reports no issues and anything I tried worked fine.

I suspect a large part of this working properly is due to KVO improvements done in Swift itself. I'll keep an eye on this in future projects.

from swift-essentials.

radianttap avatar radianttap commented on June 2, 2024

This is first time I hear about the progress property, thanks for letting me know. Feel free to fork and play with it – I'll be very happy to accept pull requests for this.

from swift-essentials.

ghowen avatar ghowen commented on June 2, 2024

Thanks. After a good night's sleep it wasn't so hard to figure out: #6 fixes this.

from swift-essentials.

radianttap avatar radianttap commented on June 2, 2024

Will need to investigate some other solution (see my comment on the PR 6).

from swift-essentials.

ghowen avatar ghowen commented on June 2, 2024

OK. There seems to be a conflict between two official documentations :) The developer docs and the comment from Apple in the NSOperation.h.

from swift-essentials.

radianttap avatar radianttap commented on June 2, 2024

I'll need to revisit my start method override, do I even need it.

from swift-essentials.

ghowen avatar ghowen commented on June 2, 2024

I filed a feedback with Apple to see what they have to say about this. I'll let you know once I know.

from swift-essentials.

radianttap avatar radianttap commented on June 2, 2024

Try with the version I just pushed (for history: this commit).

Completely different internals, start is not overriden, just main() and isFinished.

from swift-essentials.

radianttap avatar radianttap commented on June 2, 2024

Also, please do a test run with Thread Sanitizer enabled, on whatever project you are using this.

from swift-essentials.

ghowen avatar ghowen commented on June 2, 2024

Nice one! Works fine in the test project where I was troubleshooting the progress as well as in the actual project (upcoming release of https://anyfinder.info).

No complaints from Thread Sanitizer in either project.

Thanks!

from swift-essentials.

ghowen avatar ghowen commented on June 2, 2024

Not sure if this is related to the change but I am now getting a crash at another point in the app that also uses the queue.

It's a

Thread 3: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) *** -[NSKeyValueObservance retain]: message sent to deallocated instance 0x6000013bdc50

exception and when I trace it back in the call stack I land at

didChangeValue(forKey: "isFinished")

Bildschirmfoto 2020-03-30 um 14 03 26

from swift-essentials.

ghowen avatar ghowen commented on June 2, 2024

#5 (comment) is not related. My bad.

from swift-essentials.

Related Issues (3)

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.