[gimp] app: set the number of threads on GeglConfig again, it needs testing
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: set the number of threads on GeglConfig again, it needs testing
- Date: Wed, 28 Jun 2017 17:07:47 +0000 (UTC)
commit 1f5739de57de85780fd2b8f74049e4c1d6b519fa
Author: Michael Natterer <mitch gimp org>
Date: Wed Jun 28 19:05:58 2017 +0200
app: set the number of threads on GeglConfig again, it needs testing
- enable the setting code in gimp-gegl.c again
- but set the default to one thread in GimpGeglConfig, with a CPP warning
- rename "processors" to "threads" in the GUI
- add a warning box about unexpected results when increasing #threads
app/config/gimpgeglconfig.c | 7 ++++++-
app/config/gimprc-blurbs.h | 2 +-
app/dialogs/preferences-dialog.c | 12 +++++++++++-
app/gegl/gimp-gegl.c | 8 --------
4 files changed, 18 insertions(+), 11 deletions(-)
---
diff --git a/app/config/gimpgeglconfig.c b/app/config/gimpgeglconfig.c
index 05569ef..e17d2cc 100644
--- a/app/config/gimpgeglconfig.c
+++ b/app/config/gimpgeglconfig.c
@@ -139,9 +139,14 @@ gimp_gegl_config_class_init (GimpGeglConfigClass *klass)
num_processors = MIN (num_processors, GIMP_MAX_NUM_THREADS);
+#ifdef __GNUC__
+#warning Defaulting # of threads to 1
+#endif
+ num_processors = 1;
+
GIMP_CONFIG_PROP_UINT (object_class, PROP_NUM_PROCESSORS,
"num-processors",
- "Number of processors to use",
+ "Number of threads to use",
NUM_PROCESSORS_BLURB,
1, GIMP_MAX_NUM_THREADS, num_processors,
GIMP_PARAM_STATIC_STRINGS);
diff --git a/app/config/gimprc-blurbs.h b/app/config/gimprc-blurbs.h
index 7d3ddf8..b9a97b3 100644
--- a/app/config/gimprc-blurbs.h
+++ b/app/config/gimprc-blurbs.h
@@ -253,7 +253,7 @@ _("Sets the size of the navigation preview available in the lower right " \
"corner of the image window.")
#define NUM_PROCESSORS_BLURB \
-_("Sets how many processors GIMP should try to use simultaneously.")
+_("Sets how many threads GIMP should use for operations that support it.")
#define PALETTE_PATH_BLURB \
"Sets the palette search path."
diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c
index 82de4f4..e1339a3 100644
--- a/app/dialogs/preferences-dialog.c
+++ b/app/dialogs/preferences-dialog.c
@@ -1080,8 +1080,18 @@ prefs_dialog_new (Gimp *gimp,
#ifdef ENABLE_MP
prefs_spin_button_add (object, "num-processors", 1.0, 4.0, 0,
- _("Number of _processors to use:"),
+ _("Number of _threads to use:"),
GTK_TABLE (table), 4, size_group);
+
+ vbox2 = g_object_new (GIMP_TYPE_HINT_BOX,
+ "icon-name", GIMP_ICON_DIALOG_WARNING,
+ "hint", _("Threading support is not yet stable.\n"
+ "Setting this to greater than one might\n"
+ "result in image errors or crashes."),
+ NULL);
+ gtk_table_attach (GTK_TABLE (table), vbox2, 1, 2, 5, 6,
+ GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
+ gtk_widget_show (vbox2);
#endif /* ENABLE_MP */
/* Hardware Acceleration */
diff --git a/app/gegl/gimp-gegl.c b/app/gegl/gimp-gegl.c
index db6a3c1..143bb0b 100644
--- a/app/gegl/gimp-gegl.c
+++ b/app/gegl/gimp-gegl.c
@@ -49,15 +49,9 @@ gimp_gegl_init (Gimp *gimp)
config = GIMP_GEGL_CONFIG (gimp->config);
-#ifdef __GNUC__
-#warning not setting GeglConfig:threads
-#endif
-
g_object_set (gegl_config (),
"tile-cache-size", (guint64) config->tile_cache_size,
-#if 0
"threads", config->num_processors,
-#endif
"use-opencl", config->use_opencl,
NULL);
@@ -87,11 +81,9 @@ gimp_gegl_notify_tile_cache_size (GimpGeglConfig *config)
static void
gimp_gegl_notify_num_processors (GimpGeglConfig *config)
{
-#if 0
g_object_set (gegl_config (),
"threads", config->num_processors,
NULL);
-#endif
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]