Deadlock Empire - a game for developers


Habr, as you know, is not a place for games, but we found one exception, which, in our opinion, is worthy of mention here!

Meet: Deadlock Empire !

The essence of the game is to manage the layout of the flows, the code of which is given in the tasks. You need to manage it in such a way as to achieve an error situation: deadlocks, repeated counters, reaching certain sections of code and other unforeseen situations that you need to be aware of when developing multi-threaded applications.

The gameplay is a step-by-step execution of program flows in the debugger with the difference that here you are literally telling the selected thread to execute the next line of code, rather than inserting a breakpoint into its code. Usually one line of code is executed at a time, but if the line represents a non-atomic operation, it must be manually expanded to perform its constituent operations one at a time. However, you are not completely in control of the situation: if a process is blocked, for example, on a mutex, it will be inactive until another thread releases it.

Tasks are sorted by complexity and organized into sections:

  1. Unsynchronized code . The tasks in this section provide basic concepts of what happens when threads that use shared thread-safe resources run in parallel.
  2. . , , .
  3. . , .
  4. . , !
  5. . , .
  6. . , : , , !

The sample code is written in C #, and the synchronization primitives are taken from .Net, but even if you are not familiar with either one or the other, you should not be scared. Minimum programming knowledge and ability to read in English (all tasks are provided with comments and links to documentation) are highly likely to call you to reach at least the middle. Well, seniors (even 23-year-olds) will certainly defeat the boss who will appear in the final! And even those who ate the dog on the synchronization of streams will have a good time solving interesting problems, since the authors managed to make fun what in real life is one of the worst nightmares for the developer.

The game is useful as a learning tool and is strictly recommended to all novice developers, at least in .Net and Java. 

We wish you all a good Friday and a speedy victory over the Boss! :)

All Articles