Are memory-barriers required when joining on a thread?

前端 未结 3 1400
一整个雨季
一整个雨季 2020-12-29 17:20

If a thread A spawns another thread B with the single purpose of writing to a variable V and then waits for it to terminate, are memory-barriers required to ensure that subs

3条回答
  •  时光说笑
    2020-12-29 18:00

    No, synchronization mechanisms generate implicit memory fences. All data modified by a thread will be visible after the thread is joined.

提交回复
热议问题