You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2021/05/11 09:02:32 UTC

[GitHub] [incubator-brpc] wwc7654321 opened a new pull request #1400: Update atomic_instructions.md

wwc7654321 opened a new pull request #1400:
URL: https://github.com/apache/incubator-brpc/pull/1400


   The member function "operator="  of std::atomic<bool>  is using memory fence "memory_order_seq_cst" (checked msvc142/gcc4.8.2) as default. So the shown error in example 1 will not occur if the type of "ready" is std::atomic<bool> (just the same as it in example 2).
   Added a comment to clarify the "ready" in example 1 is "bool", to make sure it make sense.
   
   std::atomic<bool> 的operator= 重载中,默认使用最严格内存序memory_order_seq_cst (查看msvc142/gcc4.8.2),因此示例1 的问题,在ready是std::atomic<bool>时应该不会出现问题。  如果读者默认示例1和示例2 ready的类型相同(都是std::atomic<bool>),可能存在误解。
   因此将示例1中的ready注释为裸bool以确保引发问题
   


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

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



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


[GitHub] [incubator-brpc] wwbmmm merged pull request #1400: Update atomic_instructions.md

Posted by GitBox <gi...@apache.org>.
wwbmmm merged pull request #1400:
URL: https://github.com/apache/incubator-brpc/pull/1400


   


-- 
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-unsubscribe@brpc.apache.org

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



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


[GitHub] [incubator-brpc] tbago commented on pull request #1400: Update atomic_instructions.md

Posted by GitBox <gi...@apache.org>.
tbago commented on pull request #1400:
URL: https://github.com/apache/incubator-brpc/pull/1400#issuecomment-839807085


   Travis CI is not working now. So all pull request will failed.


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

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



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


[GitHub] [incubator-brpc] wwc7654321 commented on pull request #1400: Update atomic_instructions.md

Posted by GitBox <gi...@apache.org>.
wwc7654321 commented on pull request #1400:
URL: https://github.com/apache/incubator-brpc/pull/1400#issuecomment-838270463


   Only edited .md file. Will it cause build fail?


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

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



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