Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-128594 Wasm Event Dispatcher Asyncify Redesign
  3. QTBUG-129749

Make event dispatcher suspend and resume correctly

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Unresolved
    • P2: Important
    • None
    • Core: Event loop
    • None
    • WebAssembly
    • 16fdbbf44 (dev)

    Description

      The Qt event loop is continuously processing events, and returns control to the browser after event processing is done. When asyncify is enabled this is done by suspending and resuming.

      processEvents() should

      • Suspend/resume once when called to process native events
      • Suspend and wait if WaitForMoreEvents is set

      Normally, QEventLoop uses WaitForMoreEvents to "pause" in between events. Calling processEvents() in a loop with a sleep() delay is also supported, and is done by the QTest

      Event handlers should

      • Resume when called, if Qt was suspended
      • Suspend when done, if Qt was suspended
      • Queue the event if Qt is suspended, but is unable to processes events at this point
        • can happen if QEventLoop::ExcludeUserInputEvents is passed to processEvents()
        • can happen if the wasm module is suspended somewhere else than processEvents(), e.g. in QFile::read() waiting for file data
      • Can an event handler detect if the wasm module is suspended via 3rdparty code?
        • e.g in some File::read_all() - it may be surprising to the application if Qt starts processing input hevens before read_all() returns.
        • If not then suspend/resume needs to be cooperative via a common API (like QEventLoop)

       

      Attachments

        For Gerrit Dashboard: QTBUG-129749
        # Subject Branch Project Status CR V

        Activity

          People

            sorvig Morten Sørvig
            sorvig Morten Sørvig
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes