Rewrite task allocate method for fork/exit at run time in the future