threads with files