Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random hash table error
Message
From
09/05/2007 12:39:24
Bill Oeftering
Mainstreet Computers, Inc.
Belleville, Michigan, United States
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01220066
Message ID:
01223853
Views:
16
Sorry for the delya in responding. This is the full stack trace return by the exception object.
Here's the text from help on the hash table, I'm not sure if it's thread safe for multiple writers: What do you think ?

Hashtable is thread safe for use by multiple reader threads and a single writing thread. It is thread safe for multi-thread use when only one of the threads perform write (update) operations, which allows for lock-free reads provided that the writers are serialized to the Hashtable. To support multiple writers all operations on the Hashtable must be done through the wrapper returned by the Synchronized method, provided that there are no threads reading the Hashtable object.

Enumerating through a collection is intrinsically not a thread safe procedure. Even when a collection is synchronized, other threads can still modify the collection, which causes the enumerator to throw an exception. To guarantee thread safety during enumeration, you can either lock the collection during the entire enumeration or catch the exceptions resulting from changes made by other threads.
Previous
Reply
Map
View

Click here to load this message in the networking platform