Add NUM_THREADS configuration

Signed-off-by: Xmister <xmisterhu@gmail.com>