Mir

Merge lp://qastaging/~afrantzis/mir/glib-main-loop-spike-wip into lp://qastaging/mir

Proposed by Alexandros Frantzis
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
Reviewer Review Type Date Requested Status
Mir development team Pending
Review via email: mp+240150@code.qastaging.launchpad.net

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/straightforward than our asio version and whether you
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://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#GSourceFuncs

To post a comment you must log in.
2015. By Alexandros Frantzis

Use built-in glib signal source

Unmerged revisions

2015. By Alexandros Frantzis

Use built-in glib signal source

2014. By Alexandros Frantzis

GLibMainLoop WIP spike hack-o-rama

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches