question

TZacks-2728 avatar image
0 Votes"
TZacks-2728 asked TZacks-2728 commented

Record and thread safety

we know List<T> is not thread safe and i heard Record class is thread safe but unfortunate that not a single code example found where multiple thread and Record class has been used together to show Record class is thread safe.

anyone can come with a example which show Record class is thread safe. Thanks

dotnet-csharp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

karenpayneoregon avatar image
0 Votes"
karenpayneoregon answered TZacks-2728 commented

Don't have a sample but can say that since a record is immutable it's thread safe.

See this


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

anyway i am looking for a sample program with Record type and multi threading.

0 Votes 0 ·