add semaphore implements based on FIFO and memery mapping.