Git Product home page Git Product logo

Comments (1)

stylewarning avatar stylewarning commented on May 25, 2024

(CCing @kilimanjaro @notmgsk)

I think this is an item worth implementing soon, especially given @kilimanjaro's work to allow for-effect computations, and my work on custom allocators. My inclination is to have something like the following:

  • Remove the current persistent/shared memory CLI options.
  • Add an option like --allow-persistence that enables APIs to allow persistent connections.
  • Add a global database **persistent-qvms** which maps a fixnum token to a (qvm lock metadata) triplet. There should be a wrapper macro (with-persistent-qvm (qvm token) &body body) that binds qvm to the persistent qvm named by token, but first gated by acquiring and releasing the lock. It would be something like
(QVM TOKEN METADATA) := lookup TOKEN
with LOCK held:
    if QVM was marked for deletion: error
    bind QVM to variable:
        execute body
  • Add an endpoint MAKE-PERSISTENT-QVM to create a new persistent QVM, which includes the kind of QVM, what kind of allocation it has, etc. This gives you back some kind of token, and it internally adds to a global database **persistent-qvms**.
  • Add an endpoint PERSISTENT-QVM-INFO to describe a QVM named by a token.
  • Add an endpoint DELETE-PERSISTENT-QVM to delete a QVM. I don't expect in general that this is called often, but seems reasonable.
  • Ensure all of the QVMs are released on exit.
  • Define which API methods can use the token as input. A quick hack would be to bind a special variable *persistent-token* and have make-appropriate-qvm do the lookup. But I'd rather not make qvm-app more hacky.

The biggest challenge is going to make sure we don't spaghettify the code more. There's an outstanding issue #40 which generically touches on this. Maybe we can do this surgery carefully, cleaning up previous mistakes.

(I think one way to start this is to get rid of passing around this extraneous noise model information all over the place. But maybe that's too hard for now. Perhaps we do away with Kraus operators in Quil files, but that's for another issue.)

from qvm.

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.