Merge lp://qastaging/~afrantzis/mir/glib-main-loop-spike-wip into lp://qastaging/mir
Status: | Work in progress |
---|---|
Proposed branch: | lp://qastaging/~afrantzis/mir/glib-main-loop-spike-wip |
Merge into: | lp://qastaging/mir |
Diff against target: |
2437 lines (+2097/-98) 20 files modified
CMakeLists.txt (+1/-0) debian/control (+1/-0) include/common/mir/time/clock.h (+1/-0) src/common/time/high_resolution_clock.cpp (+9/-0) src/include/common/mir/basic_observers.h (+2/-95) src/include/common/mir/thread_safe_list.h (+186/-0) src/include/common/mir/time/high_resolution_clock.h (+2/-1) src/include/server/mir/glib_main_loop.h (+84/-0) src/server/CMakeLists.txt (+4/-0) src/server/default_server_configuration.cpp (+2/-1) src/server/display_server.cpp (+1/-0) src/server/glib_main_loop.cpp (+726/-0) tests/integration-tests/CMakeLists.txt (+2/-0) tests/unit-tests/CMakeLists.txt (+2/-0) tests/unit-tests/client/test_periodic_perf_report.cpp (+4/-0) tests/unit-tests/graphics/mesa/test_display.cpp (+2/-1) tests/unit-tests/logging/message_processor_report.cpp (+4/-0) tests/unit-tests/test_asio_main_loop.cpp (+4/-0) tests/unit-tests/test_glib_main_loop.cpp (+901/-0) tests/unit-tests/test_thread_safe_list.cpp (+159/-0) |
To merge this branch: | bzr merge lp://qastaging/~afrantzis/mir/glib-main-loop-spike-wip |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mir development team | Pending | ||
Review via email:
|
Description of the change
Please don't spend time code reviewing this branch, it's only meant to
communicate the general approach taken for the GLib version of the main
loop. However, please do take a look and let me know if you feel this is
less/more clear/straightf
like the general direction or not. See [1] for the way glib sources
work, which should aid your understanding.
Some integration tests are failing/hanging with this branch and the
culprit is the signalfd based signal source. The problem turns out to be
that in order for signalfd to catch a signal, the signal needs to be
blocked in *all* threads. Usually that translates to blocking the
signals in main() so all threads will inherit the signal mask.
Unfortunately, this doesn't work for us since we are a library and can't
enforce a signal mask in the general case.
Next steps:
1. Replace signalfd with something else (probably just signal handlers
+ self-pipe to notify main loop), or (less likely) find a way to
enforce a global signal mask.
2. Start proposing the changes in cleaned-up, small steps:
* Infrastructure changes (e.g. ThreadSafeList, Clock)
* GLibMainLoop basic start/stop + tests
* GLibMainLoop signal handing + tests
* GLibMainLoop fd handing + tests
* GLibMainLoop timers + tests
* GLibMainLoop queued events (ServerAction) + tests
* GLibMainLoop as a proper MainLoop extension, and
a mechanism to select it instead of AsioMainLoop
[1] https:/
Unmerged revisions
- 2015. By Alexandros Frantzis
-
Use built-in glib signal source
- 2014. By Alexandros Frantzis
-
GLibMainLoop WIP spike hack-o-rama