Snap! supports parallelism! Let's explore some of the fun/challenges of concurrent programming, nondeterminism. In this context, this means we cannot pre-determine what the results will be; determinism means we could predict what the outputs would be.

One of the first exercises we always have parallel programming students do (in other languages) is to have a "dispatcher" start up 10 "workers" (other languages typically call these threads), numbered 1-10, and all the workers do is shout out "Hello from thread #i" (where i is a number from 1-10). The neat thing that always results is that the result looks something like a random permutation of "Hello from thread #i" numbers, almost never in order. Every time the program runs, a different order comes out. It is neat to see that, and realize when programming concurrently, we need to understand that (for many complicated reasons), the workers may take different amounts of time to return, so our computations should not depend on their order (as the printing example did).