Giter Club home page Giter Club logo

Comments (7)

ECNU3D avatar ECNU3D commented on May 31, 2024

sample

Attached the screenshot when deadlock happen, the SyncArraryQueue is the same as DispatchQueue mentioned above. The wrap_dispatch_sync is blocked by Disptachqueue.async as it is set as a barrier for SyncArraryQueue.

queue.async(flags: .barrier)

And the async task in SyncArraryQueue is pending as the GCD has reach the thread limitation. In normal case, the deadlock should not happen.

from cordova-ios.

ECNU3D avatar ECNU3D commented on May 31, 2024

The primary ask is to consider using NSOperation to have a limitation on the concurrency of the async plugin api calls instead of use dispatch queue directly and facing the potential abuse(calling it simultaneously for hundreds time) from the javascript side.

from cordova-ios.

ECNU3D avatar ECNU3D commented on May 31, 2024

Any maintainer could have a look at this issue?Or more input from myside is needed?@janpio

from cordova-ios.

brodybits avatar brodybits commented on May 31, 2024

from cordova-ios.

oliversalzburg avatar oliversalzburg commented on May 31, 2024

It sounds reasonable and the change seems minor, but I know too little of the subject to properly assess the change.

from cordova-ios.

brodybits avatar brodybits commented on May 31, 2024

It would be great if someone could post a plugin that demonstrates this issue.

From some quick research I think this would be a nice enhancement for a major release, someday in the future. It should be pretty straightforward: https://stackoverflow.com/questions/39952743/how-to-use-nsoperation-nsoperationqueue-in-objective-c

I found another really nice resource at: https://cocoacasts.com/choosing-between-nsoperation-and-grand-central-dispatch/

A pull request would definitely be welcome.

from cordova-ios.

oliversalzburg avatar oliversalzburg commented on May 31, 2024

@brodybits The PR is already at #454

from cordova-ios.

Related Issues (20)

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.