exercise of multi-thread from csci6907 advos