aled/jsi — pull request #21 by zzorn (2012-09-28 10:36:28+00:00)
Title: Thread safe query functions

Implemented thread safety for query functions (nearest*, contains), by wrapping temporary collections used by them in ThreadLocal classes. Modification operations (add, remove) remain thread unsafe, and should not be run at the same time as a query function or another modification operation.

Performance should not be significantly affected in single threaded usage, as there is only a constant overhead for query functions to fetch the thread local instances of the temporary collections before working with them.

The changes were carefully reviewed, but not yet tested in real world usage. The basic unit tests pass though.