james Last

james Last

  • NA
  • 9
  • 0

Thread safe Generic list

May 30 2006 6:29 AM

Hi,

I am considering using a Generic List to hold user defined class entries. Since this List will be accessed by multiple threads I need it to be threadsafe. It appears there is no easy way to do this as there is no synchronised method for the list.

I suppose I could lock the List whenever I access it but I am concerned this will affect performance as the list will be accessed frequently by up to approx 20 threads evry 500ms.

Can anyone suggest how i can accomplish this syncronisation?

Thanks
Macca