chaoyli edited a comment on issue #2895: Import new ThreadPool framework
URL: https://github.com/apache/incubator-doris/pull/2895#issuecomment-585763911
 
 
   This patch imports many basis class.
   
   1. scoped_refptr
       scoped_refptr is used to replace std::shared_ptr,  is generally faster 
and smaller.
       **_advantage_**
       -  only requires a single allocation, and ref count is on the same cache 
line as the object
       - the pointer only requires 8 bytes (since the ref count is within the 
object)
       -  you can manually increase or decrease reference counts when more 
control is required
       - you can convert from a raw pointer back to a scoped_refptr safely 
without worrying about double freeing
      - since we control the implementation, we can implement features, such as 
debug builds that capture the stack trace of every referent to help debug leaks.
   **_disadvantage_**
       - the referred-to object must inherit from RefCounted
       - does not support the weak_ptr use cases
   2. MonoTime/MonoDelta
       MonoTime: The MonoTime represents a particular point in time, relative 
to some fixed but unspecified reference point.
       MonoDelta: The MonoDelta class represents an elapsed duration of time, 
the delta between two MonoTime instances.
   3. CountDownLatch
        This is a C++ implementation of the Java CountDownLatch
   

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to