Several search characteristic accessors (runtime, step count, ...) are synchronized on status updates because the result depends on the search status, which may be changed from another thread. As these getters may be frequently called from stop criteria, the involved synchronization may yield significant overhead. Perhaps synchronization can be avoided, e.g. by using a volatile or atomic reference for the search status? Not sure ...
Or perhaps the guarantees for the result of methods getRuntime(), getSteps(), etc. can be relaxed instead. Is it sufficient if the result is based on the search status when entering the getter?
Several search characteristic accessors (runtime, step count, ...) are synchronized on status updates because the result depends on the search status, which may be changed from another thread. As these getters may be frequently called from stop criteria, the involved synchronization may yield significant overhead. Perhaps synchronization can be avoided, e.g. by using a volatile or atomic reference for the search status? Not sure ...
Or perhaps the guarantees for the result of methods
getRuntime()
,getSteps()
, etc. can be relaxed instead. Is it sufficient if the result is based on the search status when entering the getter?