Storing live threads and assigning them task whenever required