Comments (6)
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.
from .net-bridge.
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.
from .net-bridge.
Added you to the repo -- feel free to fix, add functionality, etc.
from .net-bridge.
from .net-bridge.
Related Issues (10)
- Cannot load class from dll HOT 3
- Import Error in Python 3.10 HOT 2
- .cinit only supports one dll HOT 3
- Run multiple threads of RScript.exe loading different dlls via CLRServer.exe HOT 1
- Valued returned by reference HOT 2
- Access constants of a static class HOT 7
- guidance on starting/stopping CLRserver and using .Net-bridge in a package HOT 2
- empty argument -dll when using only one dll HOT 2
- CRAN R package is v0.9.1, but multiple DLLs only available in v0.9.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from .net-bridge.