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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to