gpt4 book ai didi

Lucene IndexSearcher 线程安全

转载 作者:行者123 更新时间:2023-12-04 04:36:08 25 4
gpt4 key购买 nike

根据

http://wiki.apache.org/lucene-java/LuceneFAQ#Is_the_IndexSearcher_thread-safe.3F



IndexSearcher 是线程安全的。
但是,我认为这是指 Lucene 的最新实现。
我正在使用 Lucene 3.0.3,我很想知道在这个版本中 IndexSercher 是否也是线程安全的。

最佳答案

是的,它是线程安全的。直接看对应的Javadoc API :

IndexSearcher instances are completely thread safe, meaning multiple threads can call any of its methods, concurrently. If your application requires external synchronization, you should not synchronize on the IndexSearcher instance; use your own (non-Lucene) objects instead.

关于Lucene IndexSearcher 线程安全,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19726780/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com