thread-static Questions

5

Solved

How is ThreadLocal implemented? Is it implemented in Java (using some concurrent map from ThreadID to object), or does it use some JVM hook to do it more efficiently?
Renaldo asked 29/7, 2009 at 19:16

2

Solved

I'm using Parallel Extensions fairly heavily and I've just now encountered a case where using thread local storage might be sensible to allow re-use of objects by worker threads. As such I was look...
Submultiple asked 12/6, 2010 at 17:9

2

Solved

[ThreadStatic] private static Foo _foo; public static Foo CurrentFoo { get { if (_foo == null) { _foo = new Foo(); } return _foo; } } Is the previous code thread safe? Or do we need to lo...
Usn asked 6/7, 2009 at 15:24

3

Solved

I have some code where I use a thread static object in C#. [ThreadStatic] private DataContext connection I was wondering, in this case, what if any change would I get if I put the static modifi...
Mulkey asked 15/5, 2009 at 12:57

2

Solved

I am using ThreadStatic variables to store some data, but I am worried that the data I store on the thread will still be there after I am finished with it and release back to the ThreadPool. Do I n...
Njord asked 12/5, 2009 at 21:33

1

The ThreadStatic attribute declares a static variable as unique-per-thread. Do you know an easy pattern to correctly dispose such variables? What we used before ThreadStatic is a ThreadContextManag...
Lotson asked 25/9, 2008 at 11:55
1

© 2022 - 2024 — McMap. All rights reserved.