partially working thread server implemented.
there is segmentation fault involved.