define the maximum number of threads in the header file.
2005-02-14 Sven Neumann <sven@gimp.org> * app/base/pixel-processor.[ch]: define the maximum number of threads in the header file. * app/config/gimpbaseconfig.c: use the #define.
This commit is contained in:

committed by
Sven Neumann

parent
0e1077d61d
commit
9e6fd61f59
@ -1,3 +1,10 @@
|
|||||||
|
2005-02-14 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/base/pixel-processor.[ch]: define the maximum number of
|
||||||
|
threads in the header file.
|
||||||
|
|
||||||
|
* app/config/gimpbaseconfig.c: use the #define.
|
||||||
|
|
||||||
2005-02-14 Sven Neumann <sven@gimp.org>
|
2005-02-14 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/base/gimphistogram.c
|
* app/base/gimphistogram.c
|
||||||
|
@ -213,7 +213,7 @@ do_parallel_regions_single (PixelProcessor *processor)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MAX_THREADS 16
|
|
||||||
#define TILES_PER_THREAD 8
|
#define TILES_PER_THREAD 8
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -225,7 +225,7 @@ pixel_regions_do_parallel (PixelProcessor *processor)
|
|||||||
|
|
||||||
if (max_threads > 1 && tiles > TILES_PER_THREAD)
|
if (max_threads > 1 && tiles > TILES_PER_THREAD)
|
||||||
{
|
{
|
||||||
GThread *threads[MAX_THREADS];
|
GThread *threads[GIMP_MAX_NUM_THREADS];
|
||||||
gint nthreads = MIN (max_threads, tiles / TILES_PER_THREAD);
|
gint nthreads = MIN (max_threads, tiles / TILES_PER_THREAD);
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
@ -331,7 +331,7 @@ pixel_processor_set_num_threads (gint num_threads)
|
|||||||
{
|
{
|
||||||
g_return_if_fail (num_threads > 0);
|
g_return_if_fail (num_threads > 0);
|
||||||
|
|
||||||
max_threads = CLAMP (num_threads, 1, MAX_THREADS);
|
max_threads = CLAMP (num_threads, 1, GIMP_MAX_NUM_THREADS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
#define __PIXEL_PROCESSOR_H__
|
#define __PIXEL_PROCESSOR_H__
|
||||||
|
|
||||||
|
|
||||||
|
#define GIMP_MAX_NUM_THREADS 16
|
||||||
|
|
||||||
|
|
||||||
typedef void (* PixelProcessorFunc) (void);
|
typedef void (* PixelProcessorFunc) (void);
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
#include "config-types.h"
|
#include "config-types.h"
|
||||||
|
|
||||||
|
#include "base/pixel-processor.h"
|
||||||
|
|
||||||
#include "gimprc-blurbs.h"
|
#include "gimprc-blurbs.h"
|
||||||
#include "gimpbaseconfig.h"
|
#include "gimpbaseconfig.h"
|
||||||
|
|
||||||
@ -117,7 +119,7 @@ gimp_base_config_class_init (GimpBaseConfigClass *klass)
|
|||||||
GIMP_CONFIG_PARAM_RESTART);
|
GIMP_CONFIG_PARAM_RESTART);
|
||||||
GIMP_CONFIG_INSTALL_PROP_UINT (object_class, PROP_NUM_PROCESSORS,
|
GIMP_CONFIG_INSTALL_PROP_UINT (object_class, PROP_NUM_PROCESSORS,
|
||||||
"num-processors", NUM_PROCESSORS_BLURB,
|
"num-processors", NUM_PROCESSORS_BLURB,
|
||||||
1, 16, 2,
|
1, GIMP_MAX_NUM_THREADS, 2,
|
||||||
0);
|
0);
|
||||||
GIMP_CONFIG_INSTALL_PROP_MEMSIZE (object_class, PROP_TILE_CACHE_SIZE,
|
GIMP_CONFIG_INSTALL_PROP_MEMSIZE (object_class, PROP_TILE_CACHE_SIZE,
|
||||||
"tile-cache-size", TILE_CACHE_SIZE_BLURB,
|
"tile-cache-size", TILE_CACHE_SIZE_BLURB,
|
||||||
|
Reference in New Issue
Block a user