Ah. I see what you're saying.
You can do that in C# too. If you declare something in a static variable, even if it's normally allocated dynamically, it will not be garbage collected until the application terminates.
This still creates challenges for multi-threaded applications though. The performance you gain by allocating the memory statically is lost when you have to repeatedly lock/unlock the context for a thread's read/write operations.
You can do that in C# too. If you declare something in a static variable, even if it's normally allocated dynamically, it will not be garbage collected until the application terminates.
This still creates challenges for multi-threaded applications though. The performance you gain by allocating the memory statically is lost when you have to repeatedly lock/unlock the context for a thread's read/write operations.