You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/08/02 02:37:37 UTC

[GitHub] [doris] muyizi commented on a diff in pull request #11404: [improve](be) Lock times limit

muyizi commented on code in PR #11404:
URL: https://github.com/apache/doris/pull/11404#discussion_r935061948


##########
be/src/runtime/memory/chunk_allocator.cpp:
##########
@@ -86,14 +88,23 @@ class ChunkArena {
         int idx = BitUtil::Log2Ceiling64(size);
         auto& free_list = _chunk_lists[idx];
 
-        std::lock_guard<SpinLock> l(_lock);
-        if (free_list.empty()) {
-            return false;
+        if (free_list.empty()) return false;
+
+        for (int i = 0; i < TRY_LOCK_TIMES; ++i) {
+            if (_lock.try_lock()) {

Review Comment:
   > 
   
   上述结果是我用的100个线程并行进行测试的



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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


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