https://projects.osmocom.org/https://projects.osmocom.org/favicon.ico?16647414092017-09-19T23:13:27ZOpen Source Mobile CommunicationsOsmoGSMTester - Feature #2512: osmo-gsm-tester: Convert event_loop.wait to support passive pollinghttps://projects.osmocom.org/issues/2512?journal_id=54432017-09-19T23:13:27Zneelsnhofmeyr@sysmocom.de
<ul></ul><p>+1</p> OsmoGSMTester - Feature #2512: osmo-gsm-tester: Convert event_loop.wait to support passive pollinghttps://projects.osmocom.org/issues/2512?journal_id=85142018-03-26T12:21:32Zpespin
<ul></ul><p>As far as I could see now, it seems the best idea will be to re-use some of the code in modem.py and move it to event_loop.py to have an EventLoop class and public global functions which use a global instance of that object.</p>
<p>This EventLoop will contain a glib main loop inside. It will call glib_main_loop.iterate() every time we want to poll. New methods will be added to be able to register fds for passive polling instead of only having active polling functions. Also we will add methods to add/remove timer callbacks. We can then fire active polling every 0.1 seconds by using the timer registered function, and we can use the same to implement the wait() API we already have.</p>
<p>The idea is to slowly move required active polling users (python-smpp fd, wait(), sleep(), etc.) to use passive polling/timers.</p>
<p>Also interesting to look at GSource to implement management of all the fds/poll functions:<br /><a class="external" href="https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html">https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html</a><br /><a class="external" href="https://blogs.gnome.org/desrt/2012/05/09/glib-mainloop-sources-in-python-e-g-for-irclib/">https://blogs.gnome.org/desrt/2012/05/09/glib-mainloop-sources-in-python-e-g-for-irclib/</a></p> OsmoGSMTester - Feature #2512: osmo-gsm-tester: Convert event_loop.wait to support passive pollinghttps://projects.osmocom.org/issues/2512?journal_id=85962018-03-28T17:23:35Zpespin
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Feedback</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>60</i></li></ul><p>Patches re-implementing event_loop wait() and sleep() using glib loop have been usbmited to gerrit:<br /><pre>
remote: https://gerrit.osmocom.org/7559 event_loop: Use glib as mainloop impl and move modem to use event_loop
remote: https://gerrit.osmocom.org/7560 Drop event_loop global functions and import MainLoop
</pre></p>
<p>With this code, we remove part of busy polling and from here we can easily add a register_fd() and unregister_fd() APIs to event_loop to be able to use passive polling with any source using an FD. We can even implement GSource subclasses.</p> OsmoGSMTester - Feature #2512: osmo-gsm-tester: Convert event_loop.wait to support passive pollinghttps://projects.osmocom.org/issues/2512?journal_id=91442018-05-04T12:23:05Zpespin
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-1 priority-1 priority-lowest" href="/issues/3234">Feature #3234</a>: osmo-gsm-tester: poll the python-smpplib socket using non-busy approach</i> added</li></ul> OsmoGSMTester - Feature #2512: osmo-gsm-tester: Convert event_loop.wait to support passive pollinghttps://projects.osmocom.org/issues/2512?journal_id=91452018-05-04T12:24:08Zpespin
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>60</i> to <i>100</i></li></ul><p>A new more specific task <a class="issue tracker-2 status-1 priority-1 priority-lowest" title="Feature: osmo-gsm-tester: poll the python-smpplib socket using non-busy approach (New)" href="https://projects.osmocom.org/issues/3234">#3234</a> has been created to move users of event_loop which can potentially use FDs as event triggers.</p>