Well, after repeatedly searching and writing some test code, I think I have a descriptor, with no details of __gshared variables.
From here , the static module constructor is run once in the thread. Its static deconstructor works when the thread returns. Modules act as pseudo-random "instance" streams, with their member variables being their TLS variables, and their __gshared variables are like static variables for this class. In my opinion, this forms a relationship
object: class :: module : [logical collection of variables __gshared ]
and
[no-qualifier]: static :: [no-qualifier]: __gshared
where the last half of each relationship is formed by multithreading and static constructors / destructors.
As a result, I realized that __gshared fits into the module initialization.
I hope someone else comes up with a much better answer filling the hole that I can accept.
source share