-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix an annoying bug that when regularly calling invalidateAll() on a … #22
base: master
Are you sure you want to change the base?
Conversation
…SoftRefCache, it throws a NullPointerException. Somehow "ref" can be null, check line 213 while get() is still being called
let's maybe discuss this more @tpietzsch @axtimwalde ? |
Just to understand better: |
We realized that but didn't find a way to synchronize it. I.e. we have to clear the cache while a user draws in BDV. BDV renders prior requests asynchronously, and that interferes with `invalidateAll`. The best way to address this IMO would be to have a delayed call method in BDV that synchronizes with any rendering. I.e. wait for BDV to finish rendering, then do the call, then continue rendering. That would be specific to BDV though, and the next independent application that consumes something using the cache asynchronously will run into the same issue. Curious what you think would be best here.
…On March 25, 2023 7:15:00 AM EDT, Tobias Pietzsch ***@***.***> wrote:
External Email: Use Caution
Just to understand better:
The `invalidataAll()` javadoc says: "*There must be no concurrent get() operations. This may result in cache corruption and/or a deadlock.*"
Did you make sure of this and are still getting this bug?
--
Reply to this email directly or view it on GitHub:
#22 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
I think it either needs to be specific to the application, or all cache accesses must be synchronized. I would make a Potentially, the To not make it super-specific in the BDV API we could add |
… synchronization issue (imglib/imglib2-cache#22) -- which we will fix later differently
Hi, for now I made a local copy of SoftRefLoaderCache called RobustSoftRefLoaderCache (containing the change above) in hot-knife which temporarily solves the issue. How should we take it from here? |
I think it would be best to have an |
@axtimwalde but what if several renderers exist ? |
Yes, very good point. That would be a problem. |
I'll implement the |
And the parameters for running PaintHeightField.java: |
…SoftRefCache, it throws a NullPointerException. Somehow "ref" can be null, check line 213 while get() is still being called