threaded event loop for polling