View Issue Details

IDProjectCategoryView StatusLast Update
0005079The Dark ModCodingpublic26.12.2019 16:51
Reporterstgatilov Assigned Tostgatilov  
PriorityhighSeveritymajorReproducibilitysometimes
Status resolvedResolutionfixed 
Product VersionSVN 
Target VersionTDM 2.08Fixed in VersionTDM 2.08 
Summary0005079: Thread-safety of idFileSystem and background image loading
DescriptionSee discussion on forums:
  http://forums.thedarkmod.com/index.php?/topic/20187-parsing-problem-in-a-dds-file-at-mission-start/

Basically, Duzenko added a background image loading in a separate thread somewhere after 2.07. After this Grayman started experiencing random crashes on any mission load. The crashes do not happen always. Moreover, error messages are different and weird (basically, saying wrong/impossible things). It turned out that 1) background thread was not fully disabled, and 2) idFileSystem does not work with multithreading (and background thread opens files).
TagsNo tags attached.

Activities

stgatilov

stgatilov

25.12.2019 16:06

administrator   ~0011942

In svn rev 8463-8464, Duzenko added a C++-side stress test for simultaneously reading files. It broke pretty easily =)

The idea is to fix both p.1 (make sure thread is disabled under cvar) and p.2 (make idFileSystem thread-safe).
stgatilov

stgatilov

25.12.2019 16:34

administrator   ~0011943

Made idFileSystem thread-safe in svn rev 8466 (hopefully).

The Duzenko-s test passes both on Release and Debug. Missions load properly, quicksave/quickload seems to work.
I have also check FM loading performance on Shadowhide (Painter's Wife) WIP:
  all unpacked: 1m 15s
  all packed: 1m 47s
Timing is the same before and after this change, so it can be declared that synchronization overhead is negligible.
stgatilov

stgatilov

26.12.2019 16:51

administrator   ~0011945

Another change in rev 8467.
Now background should surely get no tasks when image_preload is 1 (default).

Issue History

Date Modified Username Field Change
25.12.2019 16:04 stgatilov New Issue
25.12.2019 16:04 stgatilov Status new => assigned
25.12.2019 16:04 stgatilov Assigned To => stgatilov
25.12.2019 16:06 stgatilov Note Added: 0011942
25.12.2019 16:34 stgatilov Note Added: 0011943
26.12.2019 16:51 stgatilov Note Added: 0011945
26.12.2019 16:51 stgatilov Status assigned => resolved
26.12.2019 16:51 stgatilov Resolution open => fixed
26.12.2019 16:51 stgatilov Fixed in Version => TDM 2.08