Code Monkey home page Code Monkey logo

Comments (6)

tr8dr avatar tr8dr commented on June 25, 2024

I am no longer maintaining this (aside from a JVM version). Is this from R or python? I think there are scenarios in R where it can release an object early, where it should not. If you don't mind objects piling up, you could change the code to cause the Release() function in CLRObjectProxy to do nothing.

I don't see any flaw in the C# logic. The object IDs will be unique (and increasing). The only way the object reference disappears is from the release call from R. Have seen this behavior in R myself (back when I was using R - have since switched to python).

Could alternatively create a list or queue of objects pending release, and delete the oldest ones (to avoid the R problem). The logic would be as follows: In the Release function do:

create a member variable called _pending_delete or something like that

_pending_delete.Add (obj);
if (_pending_delete.Length > somethreshold)
    <delete 1/2 of that threshold starting from oldest>
   <trim list or queue to remove the items no longer pending>

Somewhat more complex would be to:

  • queue objects for deletion when R "releases" the reference
  • if the object is touched again, the object is removed from the deletion queue
  • anything left in the queue is periodically deleted up to some threshold, so as to keep newer object in the pending state

from .net-bridge.

daveyboy103 avatar daveyboy103 commented on June 25, 2024

from .net-bridge.

tr8dr avatar tr8dr commented on June 25, 2024

Please do, feel free to submit fixes or enhancements - I will merge. I can just add you as permissioned for the project. I have improved the python side of this considerably, but against the JVM (alas have not had the time to release publicly).

from .net-bridge.

daveyboy103 avatar daveyboy103 commented on June 25, 2024

from .net-bridge.

tr8dr avatar tr8dr commented on June 25, 2024

Added you to the repo -- feel free to fix, add functionality, etc.

from .net-bridge.

daveyboy103 avatar daveyboy103 commented on June 25, 2024

from .net-bridge.

Related Issues (10)

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.