EV_APPLICATION thread safe idle actions
To see if the thread safe idle actions really thread safe.
- 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.
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.
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.
| Attachment | Size |
|---|---|
| ThreadSafeIdleHandling.zip | 7.47 KB |
- Login or register to post comments
- Add new test run report
Test runs
| ID | Date | Platform | Result |
|---|---|---|---|
| trr#105 | 1 year 33 weeks ago | Windows 64bit | Passed |