
Activity
forki commentedon Jan 2, 2015
Mhm could still be everywhere.
We could be brutal and open debugger?
On Jan 2, 2015 4:23 PM, "Vasily Kirichenko" notifications@github.com
wrote:
forki commentedon Jan 2, 2015
Do you want me to pu Debugger.Break into this line: https://github.com/fsprojects/Paket/blob/master/src/Paket/Program.fs#L213 ?
vasily-kirichenko commentedon Jan 2, 2015
Wait a minute, I'll try to reproduce it under debugger. Seem to appear after paket version updated.
vasily-kirichenko commentedon Jan 2, 2015
Cannot catch it :( Yes, add
Debugger.Breakplease.vasily-kirichenko commentedon Jan 2, 2015
vasily-kirichenko commentedon Jan 2, 2015
vasily-kirichenko commentedon Jan 2, 2015
Cannot understand what here is null tho :(
vasily-kirichenko commentedon Jan 2, 2015
vasily-kirichenko commentedon Jan 2, 2015
Maybe it's caused by concurrent access to
pathPenaltiesdictionary (if it's concurrent)?vasily-kirichenko commentedon Jan 2, 2015
It seems that 4 threads are invoking this code:
forki commentedon Jan 2, 2015
wow didn't know that Dictionary is not thread-safe.
http://msdn.microsoft.com/en-us/library/dd287191%28v=vs.110%29.aspx seems to be the one I should use, right?
vasily-kirichenko commentedon Jan 2, 2015
:) Absolutely!
Don't catch NullReferenceExceptions for now relates to #505
Use ConcurrentDictionary in global caches - references #505
forki commentedon Jan 2, 2015
WTF. Why isn't the thread-safe version the default?
Ok I changed it.
isaacabraham commentedon Jan 2, 2015
Most of the collections in the BCL aren't thread safe.
vasily-kirichenko commentedon Jan 2, 2015
All concurrent collection are much slower, for example, here http://stackoverflow.com/questions/15252115/concurrentdictionary-performance-at-a-single-thread-misunderstanding
ConcurrentDictionaryis 3x slower thanDictionary.forki commentedon Jan 2, 2015
Yep I understan that - so I think in special case one could switch to UnsafeButFasterDictionary ;-)
Do you think we can close this? Or do you still see this error
vasily-kirichenko commentedon Jan 2, 2015
I don't see it anymore. If it returns, I reopen this issue.
haf commentedon Jan 2, 2015
Just beware that ConcurrentDictionary has no notion of strict serialisability as:
Also note that ConcurrentDictionary is likely faster for your use-case of a cache, since your reads will outnumber your writes.
forki commentedon Jan 2, 2015
So all is well?
haf commentedon Jan 2, 2015
Yes ;)