add a timer
2 read threads & 1 write thread, have some bugs