EV_APPLICATION thread safe idle actions

References
Email Message:
larryl@eiffel.com
Purpose:

To see if the thread safe idle actions really thread safe.

Test procedure:
  • Download test project.
  • Compile
  • Run
  • Press "Test Once Idle" button, see the rich text outputs which are correct.
  • After 5 threads printed exited messages. Press "Test Add/Remove Idle" button, see the rich text outputs which are correct.
  • After 5 threads printed exited messages. Press "Test Obsolete Idle" button, see the rich text outputs which are incorrect at most times.
Initial Conditions:

Download test project which is attached. Compile it, run it.

In the test project, there are 5 threads by default. Each of them will execute 1 time per second. When one thread executing, it will add an idle action to EV_APPLICATION per second. The idle action will add a output message to the global output buffer. Each threads will executing 50 seconds (50 lines of output messages). In class MAIN_WINDOW, there is a idle action to read the global output buffer. It will read the global output buffer and append the text to the EV_RICH_TEXT.

Expected result:

If the EV_APPLICATION idle actions are thread safe, the 5 threads should have 5 lines of output messages each second printed in the EV_RICH_TEXT.

If the EV_APPLICATION idle actions are not thread safe, there will be more messages printed in the EV_RICH_TEXT sometimes, sometimes there will be less messages printed in the EV_RICH_TEXT.

AttachmentSize
ThreadSafeIdleHandling.zip7.47 KB

Test runs

IDDatePlatformResult
trr#1051 year 33 weeks agoWindows 64bitPassed