Assignment name: process_communication Expected files: process_communication.c Allowed functions: memset, printf, malloc, free, write, fork, exit, waitpid, sem_open, sem_close, sem_post, sem_wait, sem_unlink, usleep, gettimeofday ------------------------------------------------------------------------------- Implement a producer-consumer pattern using processes and semaphores: 1. Create 2 semaphores: one for empty slots (init: 5) and one for filled slots (init: 0) 2. Launch 2 producer processes and 2 consumer processes 3. Producers "produce" items (increment a counter) and signal consumers 4. Consumers wait for items, "consume" them, and signal producers 5. Each process performs 10 operations 6. Use a third semaphore to protect the shared counter (mutual exclusion) Since processes don't share memory, print actions instead of actually sharing data: - Producer: "Producer : Produced item (empty slots: )" - Consumer: "Consumer : Consumed item (filled slots: )" Parent waits for all children and cleans up semaphores. Usage: `./process_communication` Hint: This demonstrates how semaphores coordinate processes (like mutexes for threads). You need 3 semaphores: empty slots, filled slots, and mutex for critical sections. The pattern is similar to producer_consumer but with processes instead of threads. Since processes don't share memory, focus on demonstrating synchronization patterns. sem_wait() on empty before producing, sem_post() on filled after producing.