lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [lucenenet] NightOwl888 opened a new pull request #441: Reviewed concurrent collections (Closes #417)
Date Sun, 14 Mar 2021 01:13:42 GMT

NightOwl888 opened a new pull request #441:
URL: https://github.com/apache/lucenenet/pull/441


   Combined with #439, this closes #417.
   
   This review included the following collections:
   
   - `LurchTable<TKey, TValue>`
   - `ConcurrentDictionary<TKey, TValue>`
   - `ConcurrentQueue<T>`
   - `ConcurrentStack<T>`
   - `ConcurrentBag<T>`
   - `BlockingCollection<T>`
   
   With the exception of `FieldCacheImpl`, all access to these collections were checked to
ensure proper use. Locks were added in cases where they were missing, and collections were
swapped for non-synchronized versions in cases where there was no reason to use one. 
   
   There are a few places we use `ConcurrentDictionary<TKey, TValue>` just to take advantage
of the fact that its enumerator allows modification of the collection without throwing an
exception. `FEATURE_DICTIONARY_REMOVE_CONTINUEENUMERATION` was added so we will be able to
use `Dictionary<TKey, TValue>` in .NET 5.x+ because it now supports modification during
enumeration also.
   
   There were a few bugs found and fixed with `GetOrAdd` method calls and one found in the
`LuceneTestCase` class (the base class for all tests in the TestFramework) which replaced
the collection with a concurrent one, but didn't take into account the other related code
that was inside of the lock that was removed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message