3 ms·
I specifically said "1000 linked lists" with an unknown amount of nodes in each. "Just keep four cursors" - why four and not N? This involves rather ugly and n
by _yosefk 14y ago
I specifically said "1000 linked lists" with an unknown amount of nodes in each.
"Just keep four cursors" - why four and not N? This involves rather ugly and not quite portable/"scalable" code (different processors can issue different amounts of outstanding memory requests). For a large N, you run out of register names for variables, and register renaming only gets you so far.
There are cases when ILP is easier to express than TLP and there are the opposite cases; it's not "just as easy" - in many cases one is much easier than the other. Having to keep multiple cursors is the perfect example when TLP is easier; consider the fact that different lists have different lengths, which a load balancing scheduler can take care of nicely without any programming effort and your single-threaded version will have trouble with.