Why is my code apparently calling LocalDataStoreMgr.GetNamedDataSlot? Why is my code apparently calling LocalDataStoreMgr.GetNamedDataSlot? multithreading multithreading

Why is my code apparently calling LocalDataStoreMgr.GetNamedDataSlot?


I found this explanation

"Threads use a local store memory mechanism to store thread-specific data. The common language runtime allocates a multi-slot data store array to each process when it is created. The thread can allocate a data slot in the data store, store and retrieve a data value in the slot, and free the slot for reuse after the thread expires. Data slots are unique per thread. No other thread (not even a child thread) can get that data.

If the named slot does not exist, a new slot is allocated. Named data slots are public and can be manipulated by anyone. "

The source is :http://msdn.microsoft.com/en-us/library/system.threading.thread.getnameddataslot%28v=vs.110%29.aspx

in this article explain that is possible to rewrite this behavior

http://msdn.microsoft.com/en-us/library/6sby1byh%28v=vs.110%29.aspx

the problem i think is that .net are reusing the same name for save the slot and this cause the bad performance.

is posible than one solution is to clean the runtime callable wrappers.

i found this:

http://msdn.microsoft.com/en-us/library/system.threading.thread.disablecomobjecteagercleanup%28v=vs.100%29.aspx