You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I'm remembering correctly, the issue here is that creating instances of these classes is expensive, and involves mucking around like extracting signature files to temporary locations for loading. Instantiating these classes per-identification would be extremely slow and brittle.
It's not 100% clear if the underlying DROID objects are themselves thread-safe. Therefore, it might be simplest to make them ThreadLocal and take more care with the temporary file code so the per-thread instances don't collide. If they are threadsafe, we may be able to statically declare them, although I'm not sure how configuration would be affected.
Obviously, it'd be good to have a unit test that put the thread-safety under a reasonable amount of strain.
n.b. Issue raised following conversation with @tballison
The text was updated successfully, but these errors were encountered:
As noted in the README the
DroidDetector
is not thread-safe.This is because we are re-using three DROID objects here:
nanite/nanite-core/src/main/java/uk/bl/wa/nanite/droid/DroidDetector.java
Lines 128 to 137 in 7c54243
If I'm remembering correctly, the issue here is that creating instances of these classes is expensive, and involves mucking around like extracting signature files to temporary locations for loading. Instantiating these classes per-identification would be extremely slow and brittle.
It's not 100% clear if the underlying DROID objects are themselves thread-safe. Therefore, it might be simplest to make them
ThreadLocal
and take more care with the temporary file code so the per-thread instances don't collide. If they are threadsafe, we may be able to statically declare them, although I'm not sure how configuration would be affected.Obviously, it'd be good to have a unit test that put the thread-safety under a reasonable amount of strain.
n.b. Issue raised following conversation with @tballison
The text was updated successfully, but these errors were encountered: