The overload used currently is File.Open(String, FileMode, FileAccess), which provides no sharing, even when there's no logical issue with multiple threads reading from the same file simultaneously. Ideally wherever files are only being read, this would be substituted with File.Open(String, FileMode, FileAccess, FileShare) with the last parameter set to FileShare.Read.
One bug that can be caused by the current behavior happens when starting two instances of MLLE in quick succession. As MLLE attempts to initialize the tileset drop-down list, it will open tileset files to retrieve their names, and one of the instances of MLLE may crash when attempting to open a file the other instance is currently reading (this is a threading error so it might not trigger reliably).
The overload used currently is
File.Open(String, FileMode, FileAccess)
, which provides no sharing, even when there's no logical issue with multiple threads reading from the same file simultaneously. Ideally wherever files are only being read, this would be substituted withFile.Open(String, FileMode, FileAccess, FileShare)
with the last parameter set toFileShare.Read
.One bug that can be caused by the current behavior happens when starting two instances of MLLE in quick succession. As MLLE attempts to initialize the tileset drop-down list, it will open tileset files to retrieve their names, and one of the instances of MLLE may crash when attempting to open a file the other instance is currently reading (this is a threading error so it might not trigger reliably).