First pthread implementation on the listener