Lazy: “The function evaluation requires all threads to run”?

I've found an MSDN page titled How to: Refresh Watch Values explaining it.

I've found an MSDN page titled "How to: Refresh Watch Values" explaining it: When you evaluate an expression in the debugger, one of two refresh icons might appear in the Value column. One refresh icon is a circle that contains two arrows, which circle in opposite directions. The other is a circle that contains two wavy lines that resemble threads.... If the two threads appear, the expression was not evaluated because of a potential cross-thread dependency.

A cross-thread dependency means that evaluating the code requires other threads in your application to run temporarily. When you are in break mode, all threads in your application are typically stopped. Allowing other threads to run temporarily can have unexpected effects on the state of your program and causes the debugger to ignore events such as breakpoints.

I'd still like a better explanation if anyone can give it. Questions that this doesn't answer include: What kind of evaluation requires all threads to run? How does the debugger identify such a case?

What exactly happens when you click the thread refresh icon?

My guess would be that the debugger is trying to avoid influencing the application state by loading the properties for you. You have to remember, that lazy load only happens when you reference/access the properties. Now, in general, you do not want debugging to affect the state of the application, otherwise that will not give an accurate representation of what the application state should be (Think multi threaded apllications and debugging) Have a look at Heisenbug.

3 Yes, I understand that, but then the debugger would give a different warning (one that I have already seen): this expression causes side effects and will not be evaluated, which you can then click the round button with a refresh icon to force evaluation. In my case, the debugger's message is saying something very different. – Allon Guralnek Dec 16 '10 at 12:27 Ahh, but when the side effects happen in a different thread... – Cpfohl Dec 17 '10 at 20:34 @Cpfohl, see the bolded text of my answer.

A side effect may be an example of a cross-thread dependency, but not the rule. I'm still looking for a thorough, in-depth explanation. – Allon Guralnek Dec 18 '10 at 9:47.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions