Re: LDT/GDT and TCB use by threads

"Floyd, Paul" <[email protected]> Tue, 7 Jun 2022 11:14:28 +0200
Newsgroups gmane.os.freebsd.devel.threading
Message-ID <[email protected]>
Hi

I have now fixed this issue, mainly by tracing the working Valgrind x86 
Linux version.

Previously, on FreeBSD the first thread created would allocate a GDT and 
this would be reused by all other threads until the creation of the 
8192nd thread when there would no longer be a free slot and it would fail.

Now each thread gets its own GDT which is initialized as a copy of the 
parent thread's GDT. This GDT gets freed after thr_exit. No more slot 
exhaustion due to large numbers of short-lived threads being created.

A+
Paul