Project 3 - Shared Memory and Semaphores Operating System Concepts Professor Silaghi By Michael Rywalt - 2569 Answer to question: What kind of synchronization can be used and why is it needed? All that was needed was a critical section which I implemented using a mutex semaphore. The reason it is needed is that we need atomic access to the shared memory when reading and writing values to it. If we modify the counter at the same time the daemon updates the counter, the data may no longer be consistent. We also want to ensure that we don't read the data at the same time the daemon writes to it for the same reason. BUILD INSTRUCTIONS: - To build the daemon and client, simply issue the make command from the top-most directory: $ make - To build individually, issue: $ make daemon - or $ make client - To clean the build directories and remove executables, issue: $ make clean USAGE INSTRUCTIONS: Once built, change to the bin/ directory and start the daemon and client applications: $ cd bin/ $ ./daemon $ ./client Note: Daemon MUST be running before client. The client will check to make sure this is true and complain if the daemon is not present. Follow the on-screen instructions in the client to observe and modify the counter! Killing the daemon process: There are two ways to kill the daemon: - Locate the pid using the ps command and then issue a kill command: kill xxxx - where xxxx is daemon's pid. Or, if no other process that you own exists by the name 'daemon', you may issue: killall daemon - to terminate any process by the name 'daemon'. Enjoy!