-
araylist question
Hey, i have a quick question about the following arraylist:
private System.Collections.ArrayList m_workerSocketList = ArrayList.Synchronized(new System.Collections.ArrayList());
I mean, there is an arraylist created which is a 'Synchronized' arraylist...? Could someone please explain me what this is used for..?? It's kinda confusing :(
-
Re: araylist question
It is thread-safe instance of array list, thus means that you can access it from more then one thread without need to play with locking or other synchronization stuff.
-
Re: araylist question
wow, that's gr8....but it may be a tradeof between using that trick and lock. as i know the lock is the fastest locking mechanism.