T
Thibaud Bouquely
Hello !
I just read source code witch use WeakReference object to implements some
Cache system.
I can read the classic code like this
// point A
if (myWeakReference.IsAlive)
// point B
((MyClass)myWeakReference.Target).DoSomething();
// point C
I am trouble with theses code Lines :
I don't know if it is the main thread to do sometime GC.Collect() or
another thread ?
If it is another Thread, I think we need a critical section between "Point
A" and "Point C"
moreover, It is possible we use this technic with Compact Framework
application. >> do you need to be careful about something else ?
Thanks for your help !
I just read source code witch use WeakReference object to implements some
Cache system.
I can read the classic code like this
// point A
if (myWeakReference.IsAlive)
// point B
((MyClass)myWeakReference.Target).DoSomething();
// point C
I am trouble with theses code Lines :
I don't know if it is the main thread to do sometime GC.Collect() or
another thread ?
If it is another Thread, I think we need a critical section between "Point
A" and "Point C"
moreover, It is possible we use this technic with Compact Framework
application. >> do you need to be careful about something else ?
Thanks for your help !