ARTICLE

Thread Safe Collections ArrayList and Queue

Posted by Alexander Filatow Articles | Visual Basic 2010 September 24, 2004
The .NET framework provides very useful System.Collections namespace, which offers classes like ArrayList, Queue, HashTable and more. However these classes are not thread safe. The attached library provides a thread safe wrapper to some of these classes.
Download Files:
 
Reader Level:

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.

share this article :
post comment
 
Nevron Diagram
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Become a Sponsor