After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 679450 - Deprecate clutter_threads_enter()/leave()
Deprecate clutter_threads_enter()/leave()
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2012-07-05 14:26 UTC by Emmanuele Bassi (:ebassi)
Modified: 2012-07-11 20:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Deprecate clutter_threads_enter()/leave() (18.83 KB, patch)
2012-07-05 14:26 UTC, Emmanuele Bassi (:ebassi)
committed Details | Review

Description Emmanuele Bassi (:ebassi) 2012-07-05 14:26:58 UTC
The enter/leave API is not portable, and provides a false sense of security with regards to thread-safe programming with Clutter.

The proper way to write threaded apps with Clutter is to use worker threads and schedule UI updates in the main loop.

We also need to start thinking about threading if, internally, we want to switch to them for animations and event handling.

Let's start by deprecating the enter/leave API, and use an internal replacement.
Comment 1 Emmanuele Bassi (:ebassi) 2012-07-05 14:26:59 UTC
Created attachment 218094 [details] [review]
Deprecate clutter_threads_enter()/leave()

Acquiring the Clutter lock to mark critical sections is not portable,
and not recommended to implement threaded applications with Clutter.

The recommended pattern is to use worker threads, and schedule UI
updates inside idle or timeout handlers within the main loop. We should
enforce this pattern by deprecating the threads_enter()/leave()
functions. For compatibility concerns, we need internal API to acquire
the main lock during frame processing dispatch.
Comment 2 Emmanuele Bassi (:ebassi) 2012-07-11 20:15:02 UTC
pushed to master.