No documentation on threading/concurrency semantics

Create issue
Issue #132 resolved
rogerb_aviga created an issue

There is no documentation stating how to use Whoosh if your program has multiple threads and/or wants to make concurrent search requests.

For example can you call a Searcher concurrently or do you need one per thread? What about the Index instance - should one be made per thread/concurrent request or is it thread safe? Same applies to query parsers.

Comments (2)

  1. rogerb_aviga reporter

    The documentation should also mention what happens with locking (the READ/WRITE locks in the index directory). For example can there be concurrent readers? Does writing have to wait for all readers to stop? When do readers hold locks? When indexes are updated (optimize true or false) does that block readers?

  2. Matt Chaput repo owner

    Made acquiring the reader lock non-blocking to allow readers to open in parallel, added docs on threading, locking, and versioning.

    While this does create the possibility (though slimmer than before) of a writer deleting a segment just as a reader is trying to open it, the performance difference, at least on Windows, is enormous.

    Fixes issue #132.


  3. Log in to comment