<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _suicide_when_without_parent(self, parent_pid):
        '''
        Kill this process when the parent died.
        '''
        while True:
            time.sleep(5)
            try:
                # Check pid alive
                os.kill(parent_pid, 0)
            except OSError:
                # Forcibly exit
                # Regular sys.exit raises an exception
                self.stop()
                log.warning('The parent is not alive, exiting.')
                os._exit(999)