|
-
April 7th, 2009, 05:51 AM
#1
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
-
April 7th, 2009, 08:33 AM
#2
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.
- Make it run.
- Make it right.
- Make it fast.
Don't hesitate to rate my post. 
-
April 7th, 2009, 10:17 AM
#3
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.
Please rate my post if it was helpful for you.  Java, C#, C++, PHP, ASP.NET
SQL Server, MySQL
DirectX
MATH Touraj Ebrahimi
[toraj_e] [at] [yahoo] [dot] [com]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|