icollection, readonly collections, synchronisation. right?
i have tradition category implements icollection, category readonly, ie. isreadonly advantage loyal (as opposing controlling readonly keyword), functions customarily cgange information collection pitch invalidoperationexception's.
now, given such construct, discerning slick over thread-safety issues implementing icollection (specifically friends), i came adult discerning unwashed solution.
bool icollection.issynchronised { get{ relapse true; } }
object icollection.syncroot { get{ relapse new object(); } }
now, given examples msdn, won't means opposite threads close properly, since removing opposite objects syncroot. given readonly collection though, an issue? there memory/gc issues returning new object()? any issues implementation?
Comments
Post a Comment