GithubHelp home page GithubHelp logo

Ubuntu compilation error about hydra HOT 3 OPEN

malcommac avatar malcommac commented on May 18, 2024 1
Ubuntu compilation error

from hydra.

Comments (3)

sage444 avatar sage444 commented on May 18, 2024

I'm looking for solution in code and found that this check self.queue != DispatchQueue.main is not relevant for the rest of function. Let me clarify

		guard self.queue != DispatchQueue.main else { // there is check of self.queue and main 
...
		_ = semaphore.wait(timeout: .distantFuture) // call to semaphore.wait in outside context not self.queue 

from hydra.

sage444 avatar sage444 commented on May 18, 2024

The root of this issue is that DispatchQueue is not Equatable on Linux. SO recommends using of setSpecific/getSpecific to tag queue and later distinguish but in my opinion for this particular case easiest solution is to use Thread.isMainThread

from hydra.

sage444 avatar sage444 commented on May 18, 2024

I ended up removing that check for main queue:). After that.

The worst case scenario is calling await from some thread and providing the same thread as context that leads to little disaster:). AFAIK GCD's API does't provide functions for easy mitigation from this case. The correct solution requires additional queue for all calls from outside to ensure that we aren't locking sensitive threads, but it's more foolproofing in my opinion.

Calling semaphore.wait in main thread is not as bad as first case and I can imagine some practical reasons to do it.

from hydra.

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.