Opening files reading first line in different threads