wasphin commented on code in PR #3122:
URL: https://github.com/apache/brpc/pull/3122#discussion_r2478775947
##########
src/bthread/task_control.h:
##########
@@ -30,6 +30,11 @@
#include <vector>
#include <array>
#include <memory>
+#include <set>
+#include <regex>
+#if defined(OS_MACOSX)
+#include <mach/mach.h>
Review Comment:
If the implementation move to source file, platform details can also move to
souce file.
##########
src/bthread/task_control.h:
##########
@@ -30,6 +30,11 @@
#include <vector>
#include <array>
#include <memory>
+#include <set>
+#include <regex>
Review Comment:
Can move to source file.
##########
src/bthread/task_control.h:
##########
@@ -91,6 +96,36 @@ friend bthread_t init_for_pthread_stack_trace();
// If this method is called after init(), it never returns NULL.
TaskGroup* choose_one_group(bthread_tag_t tag);
+ static int parse_cpuset(std::string value, std::vector<unsigned>& cpus);
+
+ static inline void bind_thread_to_cpu(pthread_t pthread, unsigned cpuId) {
Review Comment:
`cpuId` -> `cpu_id` for consistency.
##########
src/bthread/task_control.h:
##########
@@ -91,6 +96,36 @@ friend bthread_t init_for_pthread_stack_trace();
// If this method is called after init(), it never returns NULL.
TaskGroup* choose_one_group(bthread_tag_t tag);
+ static int parse_cpuset(std::string value, std::vector<unsigned>& cpus);
+
+ static inline void bind_thread_to_cpu(pthread_t pthread, unsigned cpuId) {
Review Comment:
Better not inline and put impl in the source file if not performance
mattered.
--
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]