adonis0147 commented on code in PR #1950:
URL: https://github.com/apache/incubator-brpc/pull/1950#discussion_r990900962


##########
src/bthread/task_group.cpp:
##########
@@ -248,6 +248,10 @@ int TaskGroup::init(size_t runqueue_capacity) {
     return 0;
 }
 
+#if defined (__linux__) && defined (__aarch64__)
+#pragma clang optimize off

Review Comment:
   > 给函数声明加上__attribute__((optnone))会不会更简单一些。
   
   嗯,我试试看。
   
   > 只给这俩函数加会不会不够。其它用到tls、且存在bthread切换的代码也可能会有类似的问题
   
   
这个我不太确定,最开始我是禁止Clang优化整个`src/bthread/task_group.cpp`,发现可以。然后经过不断尝试,直到发现只需要禁止这2个函数,在我们的场景下就可以成功运行。
   
   > 能否找出clang具体是哪个优化选项导致了这个问题
   
   这个目前不清楚。。。



-- 
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: dev-unsubscr...@brpc.apache.org

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


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

Reply via email to