Improve thread ids, add spawn
Return the thread id when calling spawn