example code of block and multi-thread