socket and semaphore