VOOZH about

URL: https://www.geeksforgeeks.org/c-sharp/c-sharp-check-if-hashtable-is-synchronized-thread-safe/

⇱ C# | Check if Hashtable is synchronized (thread safe) - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

C# | Check if Hashtable is synchronized (thread safe)

Last Updated : 11 Jul, 2025
Hashtable.IsSynchronized Property is used to get a value indicating whether access to the Hashtable is synchronized(thread-safe). Syntax:
public virtual bool IsSynchronized { get; }
Return Value: This property return true if access to the Hashtable is synchronized (thread-safe), otherwise it returns false. The default is false. Below programs illustrate the use of above-discussed property: Example 1:
Output:
has1 is Not Synchronized.
smyTable is Synchronized.
Example 2:
Output:
False
Note: A Hashtable can support one writer and multiple readers concurrently. To support multiple writers, all operations must be done through the wrapper returned by the Synchronized method. Reference:
Comment

Explore