freebsd-nq/sys
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
..
alpha In some cases, sf_buf_alloc() should sleep with pri PCATCH; in others, it 2004-04-03 09:16:27 +00:00
amd64 In some cases, sf_buf_alloc() should sleep with pri PCATCH; in others, it 2004-04-03 09:16:27 +00:00
arm
boot mdoc fix: put the end-of-list macro after the last list element. 2004-04-03 12:14:30 +00:00
cam
coda
compat Remove ps_argsopen from this check, because of two reasons: 2004-04-01 00:04:23 +00:00
conf Moved 3ware 9000 driver (twa) stuff from sys/conf/NOTES to /sys/i386/conf/NOTES. 2004-04-02 18:50:56 +00:00
contrib Shut up a couple of annoying gcc warnings. Do not enclose the fixes with 2004-03-30 18:28:30 +00:00
crypto
ddb
dev Correct a potential panic condition that could be caused when getting or 2004-04-03 15:28:25 +00:00
fs Remove ps_argsopen from this check, because of two reasons: 2004-04-01 00:04:23 +00:00
geom Move the name attribute to the end of the conftxt line to simplify 2004-04-01 01:33:37 +00:00
gnu
i4b
i386 In some cases, sf_buf_alloc() should sleep with pri PCATCH; in others, it 2004-04-03 09:16:27 +00:00
ia64 In some cases, sf_buf_alloc() should sleep with pri PCATCH; in others, it 2004-04-03 09:16:27 +00:00
isa
isofs/cd9660
kern Assign thread IDs to kernel threads. The purpose of the thread ID (tid) 2004-04-03 15:59:13 +00:00
libkern Bring these files closer to style(9) conformance by comparing a 2004-03-29 21:15:41 +00:00
modules Initial check-in of the device driver for 3ware's 9000 series 2004-03-30 03:46:00 +00:00
net For now, restore an splx(s) I removed when introducing slisunitfree(). 2004-04-01 23:54:49 +00:00
net80211 Change handling of probe response frames. Previously we always dropped the 2004-04-02 23:35:24 +00:00
netatalk
netatm
netgraph
netinet Unbreak natd. 2004-04-02 17:57:57 +00:00
netinet6 UDP checksum is mandatory in IPv6 (RFC2460 p.28) 2004-04-01 13:48:23 +00:00
netipsec This file was erroneously removed from HEAD when TCP-MD5 support was MFC'd; 2004-04-03 05:31:38 +00:00
netipx
netkey
netnatm
netncp
netsmb
nfs
nfs4client
nfsclient
nfsserver
opencrypto
pc98 The twa device and related options are not needed. 2004-04-01 14:23:41 +00:00
pccard
pci Recharge the watchdog timer if there's still some TX work left. 2004-04-03 15:55:21 +00:00
posix4
powerpc In some cases, sf_buf_alloc() should sleep with pri PCATCH; in others, it 2004-04-03 09:16:27 +00:00
rpc
security
sparc64 In some cases, sf_buf_alloc() should sleep with pri PCATCH; in others, it 2004-04-03 09:16:27 +00:00
sys Assign thread IDs to kernel threads. The purpose of the thread ID (tid) 2004-04-03 15:59:13 +00:00
tools
ufs
vm
Makefile