CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Posts
    102

    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

  2. #2
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    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.

  3. #3
    Join Date
    Mar 2008
    Location
    IRAN
    Posts
    811

    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
  •  





Click Here to Expand Forum to Full Width

Featured