National Flag Problem with semaphores multi-thread and multi-process