GithubHelp home page GithubHelp logo

Comments (6)

cwebber avatar cwebber commented on June 23, 2024

Heya @amirouche... I'm not sure this belongs on the bug tracker, so I'm going to close it (maybe in the future guile-user is a better place to discuss this?), but it it's a good question.

The right route is to never use locks directly. Instead, you have two patterns:

  • if there's a resource that can only be controlled by a single process at a time, set up a single fiber to handle that and read in "requests". If you also need to supply a response you can accept as an argument a "response channel" and then reply on that once you're done. Then that fiber just loops forever reading messages in and performing actions.
  • If there's a resource that can have multiple processes operating on it, but only a finite amount of them, set up a "process pool" to work on it... have a manager process receive the requests and then farm out to a fixed pool of "worker processes", otherwise following the same process as above!

Hope that helps... does that make sense to you?

from fibers.

amirouche avatar amirouche commented on June 23, 2024

That's what I had in mind, but I did not come up with the code yet.

from fibers.

amirouche avatar amirouche commented on June 23, 2024

btw, everybody on github use issues to ask questions.

from fibers.

amirouche avatar amirouche commented on June 23, 2024

That said, I will ask my questions in the mailling list in the future. I feared that my question would go without notice on the ML ...

from fibers.

cwebber avatar cwebber commented on June 23, 2024

Yeah I understand... it also sometimes makes sense to ask because maybe it wasn't a feature that Fibers provided.

Maybe what we need is a "common patterns" page so that people can see how to do these kinds of things?

from fibers.

amirouche avatar amirouche commented on June 23, 2024

Yes.

from fibers.

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.