0
Answer

Thread safe Generic list

james Last

james Last

18y
3.2k
1

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