ipc: semaphore and shared memory implementation