A thread and IO framework