From 290a4053d8a274f7b5179d8d935787c2a9f60cb9 Mon Sep 17 00:00:00 2001 From: Serein <118594118+Serein207@users.noreply.github.com> Date: Tue, 26 Dec 2023 05:18:40 +0000 Subject: [PATCH] fix post: cpp concurrency programming note (#3) * Update 2023-12-25-cpp-concurrency.md * add author --- blog/.authors.yml | 8 +++++++- blog/posts/2023-12-25-cpp-concurrency.md | 7 ++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/blog/.authors.yml b/blog/.authors.yml index 7e7f0df..a72c2c1 100644 --- a/blog/.authors.yml +++ b/blog/.authors.yml @@ -59,9 +59,15 @@ authors: avatar: https://aliyun.sastimg.mxte.cc/images/2023/12/17/QQ20220819164336a533d1c9c523e00b.th.jpg slug: url # Author profile slug url: https://wiki.sast.fun # Author website URL + Serein: + name: Serein + description: SASTer + avatar: https://avatars.githubusercontent.com/u/118594118 + slug: url # Author profile slug + url: https://wiki.sast.fun # Author website URL NONE: name: 匿名 description: SASTer avatar: https://aliyun.sastimg.mxte.cc/images/2023/12/17/QQ20220819164336a533d1c9c523e00b.th.jpg slug: url # Author profile slug - url: https://wiki.sast.fun # Author website URL \ No newline at end of file + url: https://wiki.sast.fun # Author website URL diff --git a/blog/posts/2023-12-25-cpp-concurrency.md b/blog/posts/2023-12-25-cpp-concurrency.md index 2f3ab70..b376a9c 100644 --- a/blog/posts/2023-12-25-cpp-concurrency.md +++ b/blog/posts/2023-12-25-cpp-concurrency.md @@ -6,10 +6,7 @@ categories: tags: - C++ authors: - squidfunk: - name: Serein - description: SASTer - avatar: https://avatars.githubusercontent.com/u/118594118 + - Serein --- ## 内存模型基础 @@ -509,4 +506,4 @@ void func(int *data) { 由于`读寄存器地址1`与`写flag,标记中断处理完成`这两者之间的关系是读写关系。并不能被`std::memory_order_release`约束。所以需要更强的约束来处理。 -这里可以使用`std::memory_order_acq_rel`,即对本条语句的读写进行约束。即表示写不后,读不前同时生效。 那么就可以保证`a, b, c`三个操作不会乱序。即`std::memory_order_acq_rel`可以同时表示 **写不后 && 读不前**。 \ No newline at end of file +这里可以使用`std::memory_order_acq_rel`,即对本条语句的读写进行约束。即表示写不后,读不前同时生效。 那么就可以保证`a, b, c`三个操作不会乱序。即`std::memory_order_acq_rel`可以同时表示 **写不后 && 读不前**。