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 604162 - Enable threading by default
Enable threading by default
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2009-12-09 11:24 UTC by Johan (not receiving bugmail) Dahlin
Modified: 2009-12-09 14:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Enable threading by default (1.45 KB, patch)
2009-12-09 11:24 UTC, Johan (not receiving bugmail) Dahlin
none Details | Review
Enable threading by default (1.43 KB, patch)
2009-12-09 14:38 UTC, Johan (not receiving bugmail) Dahlin
committed Details | Review

Description Johan (not receiving bugmail) Dahlin 2009-12-09 11:24:35 UTC
There's no simple way to enable threading in a gjs application,
apart from creating an external module which does it for you.
As most applications require threads these days it makes sense
to enable it by default. g_type_init() will soon enable thread
initializating per default as well.
Comment 1 Johan (not receiving bugmail) Dahlin 2009-12-09 11:24:38 UTC
Created attachment 149418 [details] [review]
Enable threading by default
Comment 2 Tommi Komulainen 2009-12-09 11:31:00 UTC
Review of attachment 149418 [details] [review]:

Shouldn't that call be placed before g_option_context_new() - as first glib call ever?

And in similar fashion shouldn't setlocale be called before option parsing to get --help translated?
Comment 3 Havoc Pennington 2009-12-09 13:59:05 UTC
This is kind of useless if gjs itself isn't threadsafe, isn't it?
We aren't doing proper locking at all, I don't think.
Comment 4 Johan (not receiving bugmail) Dahlin 2009-12-09 14:23:51 UTC
Tommi: 
Sure, I'll move it up and do it before everything else.

Havoc:
It's not useless at all, it makes it possible use libraries such as libsoup which require that glib threading is enabled. Note that the patch is not guaranteeing anything about the internals of gjs and how threading is expected to work, it's just enabling glib threading. Eventually if we want good GStreamer support we'd need to look into making gjs threadsafe, but that's a completely different bug.
Comment 5 Havoc Pennington 2009-12-09 14:29:00 UTC
oops, I didn't look at the patch ;-) thought it was enabling spidermonkey threading rather than glib threading. enabling glib threading makes sense.
Comment 6 Johan (not receiving bugmail) Dahlin 2009-12-09 14:38:09 UTC
The following fix has been pushed:
3185dfb Enable threading by default
Comment 7 Johan (not receiving bugmail) Dahlin 2009-12-09 14:38:12 UTC
Created attachment 149433 [details] [review]
Enable threading by default

There's no simple way to enable threading in a gjs application,
apart from creating an external module which does it for you.
As most applications require threads these days it makes sense
to enable it by default. g_type_init() will soon enable thread
initializating per default as well.