thread in block mode
global var of active
block mode with global var of occupied
little revise