Page MenuHomePhabricator

ecore_wl2 io processing isn't thread friendly
Open, HighPublic

Description

wayland has the function wl_display_prepare_read() to ensure thread safety. It protects against another thread accessing the fd at the same time - which could occur if, for example, the GL stack uses threads internally.

We should be using this appropriately to ensure we're safe against threaded wayland event reading.

ManMower created this task.Jul 25 2018, 8:15 AM
ManMower triaged this task as High priority.
ManMower edited projects, added efl (efl-1.22); removed efl.Jul 26 2018, 1:36 PM
ManMower added a subscriber: Hermet.

It would appear we can't fix this now.

I think part of what needs to be done is moving the wayland idle handler into an fd pre-handler, then adding an fd buffer handler that can wl_display_cancel_read if there's nothing to read.

There's a problem here when the pre-fd handler queues up a bunch of events before we enter poll(), and EFL doesn't dispatch those events until poll() completes, which could be an awfully long time if clients aren't doing anything because they're waiting for the events we didn't dispatch. There is a patch for this but it's probably too dangerous to land during a freeze.

Is the patch on Phab ? I realize we cannot land it yet, but I'd be interested in testing it