Reader Level:
ARTICLE

Thread Safe Collections ArrayList and Queue

Posted by Alexander Filatow Articles | Multithreading in C# September 24, 2004
The attached project provides a dll containing a wrapper around the non-thread safe ArrayList and Queue classes. The wrapper implements the most common functions of this collection elements.
  • 0
  • 0
  • 30432
Download Files:
 

The attached project provides a dll containing a wrapper around the non-thread safe ArrayList and Queue classes. The wrapper implements the most common functions of this collection elements.

The .NET framework provides very useful System.Collections namespace, which offers the programmer elements like ArrayList, Queue, HashTable and some more.The only thread-safe class of them is HashTable- all other objects may cause exceptions, if they are simultaneously accessed by multiple threads.

The wrapper just locks the collection during the access, so that the next intrested thread has to wait until the operation is over.

COMMENT USING

Trending up