<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - It's not safe to share wl_display fd with other threads."
href="https://bugs.freedesktop.org/show_bug.cgi?id=91273#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - It's not safe to share wl_display fd with other threads."
href="https://bugs.freedesktop.org/show_bug.cgi?id=91273">bug 91273</a>
from <span class="vcard"><a class="email" href="mailto:ppaalanen@gmail.com" title="Pekka Paalanen <ppaalanen@gmail.com>"> <span class="fn">Pekka Paalanen</span></a>
</span></b>
<pre>All libraries, including Mesa, need to be fixed to use the
prepare_read/read_events API, because that is the only API we even think as
thread-safe.
I suppose it could be nice to file bugs per library, and add them here as
blockers (or just references in case the library does not use fd.o bugzilla).
Lazily written application can use the non-safe API just fine, when they are
not threaded and assuming the libraries they use do not use the same wl_display
object from other threads. The non-safe API was there first, so apps that don't
require thread-safety have not been ported. Mixing non-safe and safe APIs is
only dangerous if their use may overlap. If you only ever have a single thread,
I believe these can be mixed safely if paying attention to the details.
As for sharing the wl_display *file descriptor*, that is never intended to
work. I mean, you cannot create multiple wl_displays from the same fd and
expect that to work. I don't think anyone even tries to, just clarifying.
Jonas' "proxy wrapper" is an attempt to solve one more threading issue.
I still don't understand what you mean by "the kernel may not wake up the
thread" if it refers to a different issue than the two mentioned above.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>