Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COI don't think this follows. The value being switched on needs to be calculated and stored in a register or on the stack. If that value is calculated based on data accessed by multiple threads, this *calculation* needs to be made thread-safe, whatever the width of the result. But then, once that result is in a register or on the stack, it's only accessed by the switching thread and is safe.
      singulars
    2. CONeil, your argument is quite confused: "But then, once that result is in a register or on the stack, it's only accessed by the switching thread and is safe". Sure, using that value is thread-safe! But my point is that *that value can _already_ be wrong due to synchronization bugs in user code*. Using thread-safely a wrong value is less than useful :) This issue can never be eliminated: buggy concurrent code could already have produced the "out of thin air"/wrong long value, which can be subsequently used in the switch, making the switch go to a case address _nobody ever specified_.
      singulars
    3. CODimitris, maybe there´s something in your argument I'm not understanding. The value switched on could indeed be wrong due to synchronization bugs in user code. But I don't believe there's anything inherent about the switch statement that makes this more likely than in other cases. And thinking it through as best I can, I don't believe that the non-atomicity of hi/low words of long reads/writes to memory is in fact an issue. (Thinking about things antoher way: you could decide that an if comparison on a long was not allowed based on the same argument.)
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload