This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Using LightSpeed 4.0.1195.19954 I'm seeing the following exception occasionally, especially under initial load (i.e. seeing multiple similar requests after an IIS reset):
Looking through Reflector, this code isn't protecting its Dictionary (where I've seen this error in code before). Is there anything I should be doing in a thread-safe App_Start or similar to prevent this occurring? |
|
|
Hmm, looks like there's a race condition deep within Dictionary that means the indexer isn't last-one-wins but can fail when called concurrently. Fix going in tonight. The only workaround is to ensure that the first execution of any given LINQ query is done in a thread-safe way, which is probably not practical unless you have a very limited number of queries. |
|
|
Yes, the .NET 3.5 dictionary is a real pain - "Not thread safe" doesn't mean "results are unpredictable", it means "we will crash and burn". I've been hit by it a few times in the past - hence why they brought out the ConcurrentDictionary in 4. Cheers! |
|