Splited shm and sem functions