add thread

add worker thread to server
add semafors sync