add multithread in analysis.py