Optimization and multithreading written by n1luik
Continue to fix compatibility issues between multithreading and mechanical power