On Thu, Sep 15, 2022 at 9:21 AM Thomas Bushnell BSG <tbushn...@google.com> wrote:
> On Thu, Sep 15, 2022 at 11:19 AM burak serdar <bser...@computer.org> > wrote: > >> On Thu, Sep 15, 2022 at 9:11 AM Thomas Bushnell BSG <tbushn...@google.com> >> wrote: >> >>> I cannot speak to "other accepted concurrency designs" here. Simply that >>> Go does not guarantee the operation you want it to, the memory model does >>> not actually imply that it does, and the last sentence of the memory model >>> is the most important one here: don't be clever. >>> >> >> I believe that's what we are discussing here. The way I read it, the >> memory model does imply that a non-synchronized operation x sequenced >> before an operation y that happened before z implies that all operations >> sequenced after z happens after x. >> > > You may be misreading requirement one as implying that no reordering > within a goroutine is ever permitted. It does not say that. What it says is > that, within one goroutine, any reordering is permissible provided the > actual value read and written by that goroutine are the correct ones. > I believe what the memory model implies is that no reordering is permitted to cross a memory barrier. An atomic operation has a memory barrier. > > Thomas > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAMV2RqoZ2J8hHY6mD_rNdJu7W4p0osW0E%2BUxx8pYnh815%3DFmTw%40mail.gmail.com.