I've started reading "The Art of Multiprocessor Programming". Seems like a great book. It claims to have examples written in Java, and it really seems this way in the beginning, to the level that they can be copied and run as-is. However, quite quickly I start to see features which I had no idea were in Java. I guess they're not and the book simply uses fancy Java-like pseudocode, but it still doesn't hurt to verify.
I'm talking about things like:
- Using the existential quantifier in a while condition, e.g.
while(\exists k != me) (level[k] >= i && victim[i] == me)
(replace \exists with the actual mathematical sign; recall that Haskell has similar things).
- Using tuples and lexicographical ordering built-in to the syntax, e.g.
(label[k], k) << (label[i], i)
Which compares the left component and if needed, the right component.
As far as I know this is pseudocode and not Java, but I'm hardly familiar with this language.