learning threads and TCP