todo:multi-thread support
add a timer
2 read threads & 1 write thread, have some bugs
replace mutex lock with semaphore
code reconstruction
2 read thread & 1 write thread