summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2004-04-03 15:59:13 +0000
committermarcel <marcel@FreeBSD.org>2004-04-03 15:59:13 +0000
commit1d37410c51d4ea614965891eab4e733f3c683f23 (patch)
treece24c4f56582c8285ccc25138fe4c0fe2f2839a9 /bin
parentcfa2fd0d84e287de795a3e2ab5bef4009c57e83a (diff)
downloadFreeBSD-src-1d37410c51d4ea614965891eab4e733f3c683f23.zip
FreeBSD-src-1d37410c51d4ea614965891eab4e733f3c683f23.tar.gz
Assign thread IDs to kernel threads. The purpose of the thread ID (tid)
is twofold: 1. When a 1:1 or M:N threaded process dumps core, we need to put the register state of each of its kernel threads in the core file. This can only be done by differentiating the pid field in the respective note. For this we need the tid. 2. When thread support is present for remote debugging the kernel with gdb(1), threads need to be identified by an integer due to limitations in the remote protocol. This requires having a tid. To minimize the impact of having thread IDs, threads that are created as part of a fork (i.e. the initial thread in a process) will inherit the process ID (i.e. tid=pid). Subsequent threads will have IDs larger than PID_MAX to avoid interference with the pid allocation algorithm. The assignment of tids is handled by thread_new_tid(). The thread ID allocation algorithm has been written with 3 assumptions in mind: 1. IDs need to be created as fast a possible, 2. Reuse of IDs may happen instantaneously, 3. Someone else will write a better algorithm.
Diffstat (limited to 'bin')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud