3 ms·
The "you can't read the values" note is referring to the API exposed to callers, not internal restrictions on the implementation.
by Strilanc 11y ago
The "you can't read the values" note is referring to the API exposed to callers, not internal restrictions on the implementation.
- JadeNB 11y agoAre you sure? That doesn't seem to match with the wording: > There's no way to read the values from the array, only to set them and compare them for equality (emphasis mine). That seems to me to mean literally what it says; that you can query two values for equality, but, either way, have no information about what the values are. EDIT: From the horse's mouth (https://news.ycombinator.com/item?id=9801189 https://news.ycombinator.com/item?id=9801189), I'm wrong.
- davidtgoldblatt 11y agoMy bad; Strilanc's interpretation is correct. I updated the wording to hopefully be a little clearer.
- JadeNB 11y agoThanks! While you're here, is oconnore (https://news.ycombinator.com/item?id=9800705 https://news.ycombinator.com/item?id=9800705 )'s solution legal according to your rules? EDIT: Also, the wording > There's no way to read the values from the array, only to set them and compare them for equality seems unchanged.
- re 11y agoThe preceding sentence was changed to be more explicit that the bullet points are about the "user-facing API" being unrealistic. They're not implementation rules/constraints.
- davidtgoldblatt 11y agoI think his solution is a little bit tongue in cheek - it shows how much easier it is to solve using transactional memory compared to low-level concurrency primitives. So it cheats by using very powerful techniques instead of the very weak ones that the post says to use. You couldn't use his solution in C++ for instance, because C++ doesn't come with garbage collection or transactional memory.
- JadeNB 11y agoI see; I don't know enough about concurrency to recognise the tongue-in-cheek-ness (or whatever). Thanks for explaining!