chenBright commented on code in PR #3096:
URL: https://github.com/apache/brpc/pull/3096#discussion_r2424323626
##########
src/butil/resource_pool_inl.h:
##########
@@ -307,6 +308,28 @@ class BAIDU_CACHELINE_ALIGNMENT ResourcePool {
const size_t n = ResourcePoolFreeChunkMaxItem<T>::value();
return n < FREE_CHUNK_NITEM ? n : FREE_CHUNK_NITEM;
}
+
+ std::list<T*> list_resources() const {
Review Comment:
The number of bthreads is limited by vm.max_map_count, so it should be
finite. Even if the number of active bthreads is too large, the bottleneck will
not be std::vector, but somewhere else. Therefore, I think using std::vector is
better.
##########
src/bthread/task_meta.h:
##########
@@ -107,7 +107,8 @@ struct TaskMeta {
// DO NOT use this field directly, use tls_bls instead.
LocalStorage local_storage{};
- // Only used when TaskTracer is enabled.
+ // Mainly used when TaskTracer is enabled. Otherwise used to just indicate
+ // if a bthread is alive.
Review Comment:
I think this is better. If the bthread is not alive, tid is old and
version_butexis new.
--
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]