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

前端 未结 5 2014
星月不相逢
星月不相逢 2020-12-05 10:46

I have a static class with some static properties. I initialized all of them in a static constructor, but then realized that it is wasteful and I should lazy-load each prope

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-05 11:10

    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

提交回复
热议问题