Or you could use that, which I didn't even realise was there...sorry. Duncan
----- Original Message ----- From: "Jim Arnold" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 16, 2002 2:11 PM Subject: Re: [DOTNET] Threading and Enumeration > > Why would you actually want to make the copy by some means other than > > enumeration? > > Because ICollection.CopyTo() (where available) is usually 10x faster? > > He says, jumping in without reading the whole thread. > > Jim > > > > > -- > > Ian Griffiths > > DevelopMentor > > > > ----- Original Message ----- > > From: "Duncan Godwin" <[EMAIL PROTECTED]> > > > > > > > Depending on what's in the collection you can either use a > > collections > > > Clone() method if you need a shallow copy, or Serialize via > > a MemoryStream > > > if you need a deep copy. > > > > > > ----- Original Message ----- > > > From: "Graeme Foster" <[EMAIL PROTECTED]> > > > > > > > The fun bit is making the copy *without enumerating* ;) > > > > > > > > -----Original Message----- > > > > From: Duncan Godwin > > > > > > > > The alternative is as mentioned in Effective Java, lock briefly, > > > > make a defensive copy of the collection, then enumerate. > > > > You can read messages from the DOTNET archive, unsubscribe > > from DOTNET, or > > subscribe to other DevelopMentor lists at http://discuss.develop.com. > > > > You can read messages from the DOTNET archive, unsubscribe from DOTNET, or > subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.