Marcel Moolenaar fdcac92868 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.
2004-04-03 15:59:13 +00:00
..
2004-03-15 13:17:24 +00:00
2004-03-12 06:51:21 +00:00
2002-03-19 20:18:42 +00:00
2003-05-31 16:54:37 +00:00
2003-12-31 22:27:51 +00:00
2003-05-01 14:40:16 +00:00
2002-03-04 21:08:35 +00:00
2003-06-22 08:41:43 +00:00
2002-11-05 17:51:56 +00:00
2003-12-24 00:51:30 +00:00
2003-02-13 17:47:44 +00:00
2002-03-19 20:18:42 +00:00
2003-08-19 16:41:12 +00:00
2003-02-21 16:24:49 +00:00
2002-03-24 03:07:07 +00:00
2002-07-10 04:47:25 +00:00
2002-03-19 20:18:42 +00:00
2003-02-12 07:00:59 +00:00
2002-03-19 20:18:42 +00:00
2004-03-12 19:06:18 +00:00
2004-03-14 00:49:09 +00:00
2003-05-22 17:07:57 +00:00
2002-03-19 20:18:42 +00:00
2002-03-19 20:18:42 +00:00
2004-02-27 16:14:27 +00:00