model: add thread ID assignment function