Если у вас версия питона >= 3.3, можете попробовать aiohttp и забыть про мороку с тредами в питоне.
import asyncio
import aiohttp
@asyncio.coroutine
def fetch_status(session, url):
status = None
try:
response = yield from session.get(url)
response.close()
status = response.status
except Exception as e:
status = e.__str__()
return status
def run():
session = aiohttp.ClientSession()
with open('domains.txt', mode='r') as f:
for url in f:
url = url.strip()
status = yield from fetch_status(session, url)
print(url, ": ", status, sep='')
session.close()
if __name__ == '__main__':
asyncio.get_event_loop().run_until_complete(run())