Depends on which hardware.  For instance, x86/64 is very specific about
what memory operations can be reordered (for cacheable operations), and two
stores aren't reordered.  The only reordering is stores followed by loads,
where the load can appear to reorder with the preceding store.
On Mon, Jan 16, 2017 at 4:02 PM Dave Cheney <d...@cheney.net> wrote:

> Doesn't hardware already reorder memory writes along 64 byte boundaries?
> They're called cache lines.
>
>
> Dave
>
>
>
> On Tue, 17 Jan 2017, 05:35 Tavian Barnes <taviana...@gmail.com> wrote:
>
> On Monday, 16 January 2017 12:38:01 UTC-5, Francesco Nigro wrote:
>
> I'm missing something for sure, because if it was true, any
> (single-threaded) "protocol" that rely on the order of writes/loads against
> (not mapped) ByteBuffers to be fast (ie: sequential writes rocks :P) risks
> to not see the order respected if not using patterns that force the
> compiler to block the re-ordering of such instructions (Sci-Fi hypothesis).
>
>
> I don't think you're missing anything.  The JVM would be stupid to reorder
> your sequential writes into random writes, but it's perfectly within its
> right to do so for a single-threaded program according to the JMM, as long
> as it respects data dependencies (AFAIK).  Of course, that would be a huge
> quality of implementation issue, but that's an entirely separate class from
> correctness issues.
>
>
> with great regards,
> Francesco
>
>
>
>
>
>
>
>
>
> --
>
>
> You received this message because you are subscribed to the Google Groups
> "mechanical-sympathy" group.
>
>
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mechanical-sympathy+unsubscr...@googlegroups.com.
>
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
>
>
>
>
>
>
> --
>
>
> You received this message because you are subscribed to the Google Groups
> "mechanical-sympathy" group.
>
>
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mechanical-sympathy+unsubscr...@googlegroups.com.
>
>
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
Sent from my phone

-- 
You received this message because you are subscribed to the Google Groups 
"mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mechanical-sympathy+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to