Design of synchronization and communication mechanisms between client and server programs (semaphore version)