MAX_THREADS=3
init activeThreads and threads arrays