Shared Memory vs. Distributed Memory Shared Memory: All the processes share a single RAM. Thus any variable used by oe processor can be seen or modified by the others. We have been using the shared memory model thus far. When we do merge sort, each thread can see the partially sorted list made by other threads. You can binary search the array made by other threads. With semaphores, each thread can see not only the semaphores, but also the integer counters (nw, nww, nr, nrw, etc.) This stuff needs to be visible to all threads for it to work. Distributed memorhy: Each processor has its own RAM which is not directly accessible by the other processors. Sharing information between processors requires explicit message passing. In real life, distributed memory is the more commonly-used model. Such as SETI, MMORPGS, "The Cloud" In shared memory, we use locks, semaphores, monitors, that sort of thing, to control parallel program flow. But we don't use that stuff in distributed. We use message passing. There are tools that you can use to write distributed memory code. The tool we will be using is MPI (Message Passing Interface). This is a variation of what I learned, MPL. With this interface, you can send a specific message to another machine, receive from another machine, and variations on this theme, the variations mostly having to do with blocking vs. non-blocking. (Blocking that your machine waits until the message has been sent or received. Non-blocking means that you can other stuff while you wait.) I have found that, for relatively simple programs, non-blocking send and blocking receive work well. To install MPI on your WSL: Type mpicc and it will guide you into getting the stuff you need. mpicxx is the MPI C++ "compiler". It's not really a compiler. It's just that calls the regular with the appropriate options to load the MPI libraries. PG4 issues. If you want to add a constructor to your Person class, you are free to do this. Another issue, is how do I initialize the semaphores, they are initialized with a specific method. So, couple of ways to do this, some cool, some lame. You COULD initialize them in your Person constructor. Have some global boolean initialized to false. In your Person constructor, you can check this variable, if its false, then initialize all of our semaphores, and set the global variable to true. You could also do the same thing in the EnterBathroom code. The first called, check to see if the semaphores are initialized. Initialize as part of global var declaration. The semaphore initialization methods return an integer. So, in the global variables, you can say int a = sem_init (... )