Git Product home page Git Product logo

Comments (3)

orangeduck avatar orangeduck commented on July 18, 2024

Hey,

Yes unfortunately I've not made an effort to make very much thread safe in Cello but this is particularly bad.

I don't know if there is a way to get the exception behavior I wanted without using static variables but I'll have a little more of a think about it. An important thing I wanted for libCello was to have no Init or Finalise functions (or have any state to pass around).

One nasty way may be to introduce some fixes when we get around to finally adding Threads into the library. In which case we can store all the thread information we like on thread creation and destruction.

Anyway thanks for bringing this to my attention :)

  • Dan

from cello.

ghedo avatar ghedo commented on July 18, 2024

As I mentioned before, this is easily fixed using thread-local storage for the exceptions-related global variables. To that end I made #36. The "downside" of using TLS is that, if the pthread is created inside the try block and it throws an exception, that exception is not caught because TLS is cleaned on thread creation. But that's not really a problem, since in most cases the parent thread would probably exit from the try block before the child throws an exception anyway.

from cello.

orangeduck avatar orangeduck commented on July 18, 2024

Thanks. Didn't know about the thread local storage keywork. Cheers for the pull request :)

from cello.

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.