Friday, March 2, 2012

Find the bug - part two.

Nico, a wonderful idea! Here's my contribution:

The most complicated thing in the world to understand is concurrency. Not even Einstein's General Theory of Relativity comes close. Here is an interesting gem that I got from a newsletter quite some time ago. I found the puzzle incredibly interesting and it convinced me to NEVER EVER EVER EVER:
  1. Assume I understand concurrency.
  2. Use the old core Threading stuff rather than the new modern concurrency frameworks (i.e. Threading pools, etc.).
  3. Assume I understand concurrency.
  4. Skip testing threaded applications - because I'm clever, it makes sense... and besides I understand concurrency.
  5. Assume I understand concurrency.
Oh, I almost forgot, the most important rule is to never assume I understand concurrency (not even at a job interview at google)!

Look at the following Rorotika-inspired class and tell me what happens. Keep careful track of all the delays.

No comments:

Post a Comment