The max value of pid is changeable, in default it is 32768, which is the size of the max value of short int.And, it can compatible with UNIX of early version.
You can see and change it in /proc/sys/kernel/pid_max.
BTW,
Process ID 0 is usually the scheduler process and is often known as
the swapper. No program on disk corresponds to this process, which is
part of the kernel and is known as a system process. Process ID 1 is
usually the init process and is invoked by the kernel at the end of
the bootstrap procedure. The program file for this process was
/etc/init in older versions of the UNIX System and is /sbin/init in
newer versions. This process is responsible for bringing up a UNIX
system after the kernel has been bootstrapped.
--APUE
The tid has significance only within the context of the process to which it belongs.
In different famlies of UNIX, the pthread_t is not the same type,such as
Linux 2.4.22 uses an unsigned long integer for the pthread_t data
type. Solaris 9 represents the pthread_t data type as an unsigned
integer. FreeBSD 5.2.1 and Mac OS X 10.3 use a pointer to the pthread
structure for the pthread_t data type. --APUE
So you can't simply tell its scope .
But threads_max presents how many threads in a process at most,you can see and change it in /proc/sys/kernel/threads-max.