minimise delay due to timeout by counting outstanding requests.
outputs thread id in log file now.