public interface Threadable
In contrast to a
Parallel op, which marks an op that executes across
multiple threads, a
Threadable object knows how to provide multiple
independent versions of itself, each of which will be used from a separate
concurrent thread. Note that these versions may be deep copies, shallow
copies, or even the same instance every time, depending on the nature of the
In a nutshell:
Parallel ops make use of
for doing their work in a multithreaded way.
The requirement is merely that two threads using their respective object references as intended will not confuse one another's processing. As a rule of thumb, this means they might share read-only state, but not read-writable state (apart from perhaps lazily initialized state).
It is expected that subclasses which override this method will narrow the return type appropriately. We do not enforce this at compile time via recursive generics due to their complexity: they introduce a host of typing difficulties.
Copyright © 2014–2019 ImageJ. All rights reserved.