Github user phrocker commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/110#discussion_r123119025
  
    --- Diff: libminifi/include/core/repository/VolatileRepository.h ---
    @@ -331,22 +132,240 @@ class VolatileRepository : public core::Repository, 
public std::enable_shared_fr
         else
           return false;
       }
    -  /**
    -   * Purges the volatile repository.
    -   */
    -  void purge();
     
    - private:
       std::map<std::string, std::shared_ptr<minifi::Connection>> connectionMap;
    -
    -  std::atomic<uint32_t> current_size_;
    +  // current size of the volatile repo.
    +  std::atomic<size_t> current_size_;
    +  // current index.
       std::atomic<uint16_t> current_index_;
    -  std::vector<AtomicEntry*> value_vector_;
    +  // value vector.
    --- End diff --
    
    This is a base class. the super class MAY use a map in certain use cases. 
see https://github.com/apache/nifi-minifi-cpp/pull/113 for when the minimized 
locking is used. the vector here has the ability to be completely lock free for 
certain use cases. the computational complexity is pretty low versus the 
locking required. value_vector_ exists for the repositories that want complete 
lock free operations via CAS


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to