event driven thread