add doc comments for vips_concurrency_*()

This commit is contained in:
John Cupitt 2012-06-03 13:01:21 +01:00
parent fc3d4192d7
commit b6f902560f
2 changed files with 92 additions and 58 deletions

View File

@ -121,6 +121,19 @@ void vips__g_mutex_lock( GMutex *d ) {}
void vips__g_mutex_unlock( GMutex *d ) {} void vips__g_mutex_unlock( GMutex *d ) {}
#endif /*!HAVE_THREADS*/ #endif /*!HAVE_THREADS*/
/**
* vips_concurrency_set:
* @concurrency: number of threads to run
*
* Sets the number of worker threads that vips should use when running a
* #VipsThreadPool.
*
* The special value 0 means "default". In this case, the number of threads is
* set by the environmnt variable IM_CONCURRENCY, or if that is not set, the
* number of threads availble on the hist machine.
*
* See also: vips_concurrency_get().
*/
void void
vips_concurrency_set( int concurrency ) vips_concurrency_set( int concurrency )
{ {
@ -190,8 +203,29 @@ get_num_processors( void )
return( nproc ); return( nproc );
} }
/* Set (p)thr_concurrency() from IM_CONCURRENCY environment variable. Return /**
* the number of regions we should pass over the image. * vips_concurrency_get:
*
* Returns the number of worker threads that vips should use when running a
* #VipsThreadPool.
*
* vips gets this values from these sources in turn:
*
* If vips_concurrency_set() has been called, this value is used. The special
* value 0 means "default". You can also use the command-line argument
* "--vips-concurrency" to set this value.
*
* If vips_concurrency_set() has not been called and no command-line argument
* was used, vips uses the value of the environment variable IM_CONCURRENCY,
*
* If IM_CONCURRENCY has not been set, vips find the number of hardware
* threads that the host machine can run in parallel and uses that value.
*
* The final value is clipped to the range 1 - 1024.
*
* See also: vips_concurrency_get().
*
* Returns: number of worker threads to use.
*/ */
int int
vips_concurrency_get( void ) vips_concurrency_get( void )

View File

@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=glib&keywords=I18N+L10N&component=general\n" "product=glib&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2012-04-17 11:25+0100\n" "POT-Creation-Date: 2012-06-03 12:36+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -799,7 +799,7 @@ msgid "factors should both be >= 1"
msgstr "" msgstr ""
#: ../libvips/conversion/im_subsample.c:221 #: ../libvips/conversion/im_subsample.c:221
#: ../libvips/resample/im_shrink.c:286 #: ../libvips/resample/im_shrink.c:299
msgid "image has shrunk to nothing" msgid "image has shrunk to nothing"
msgstr "" msgstr ""
@ -1053,7 +1053,7 @@ msgstr ""
msgid "invalid markup in text" msgid "invalid markup in text"
msgstr "" msgstr ""
#: ../libvips/conversion/im_text.c:252 #: ../libvips/conversion/im_text.c:251
msgid "pangoft2 support disabled" msgid "pangoft2 support disabled"
msgstr "" msgstr ""
@ -1167,39 +1167,39 @@ msgstr ""
msgid "How to generate the extra pixels" msgid "How to generate the extra pixels"
msgstr "" msgstr ""
#: ../libvips/conversion/ifthenelse.c:395 #: ../libvips/conversion/ifthenelse.c:468
msgid "ifthenelse an image" msgid "ifthenelse an image"
msgstr "" msgstr ""
#: ../libvips/conversion/ifthenelse.c:399 #: ../libvips/conversion/ifthenelse.c:472
msgid "Condition" msgid "Condition"
msgstr "" msgstr ""
#: ../libvips/conversion/ifthenelse.c:400 #: ../libvips/conversion/ifthenelse.c:473
msgid "Condition input image" msgid "Condition input image"
msgstr "" msgstr ""
#: ../libvips/conversion/ifthenelse.c:405 #: ../libvips/conversion/ifthenelse.c:478
msgid "Then image" msgid "Then image"
msgstr "" msgstr ""
#: ../libvips/conversion/ifthenelse.c:406 #: ../libvips/conversion/ifthenelse.c:479
msgid "Source for TRUE pixels" msgid "Source for TRUE pixels"
msgstr "" msgstr ""
#: ../libvips/conversion/ifthenelse.c:411 #: ../libvips/conversion/ifthenelse.c:484
msgid "Else image" msgid "Else image"
msgstr "" msgstr ""
#: ../libvips/conversion/ifthenelse.c:412 #: ../libvips/conversion/ifthenelse.c:485
msgid "Source for FALSE pixels" msgid "Source for FALSE pixels"
msgstr "" msgstr ""
#: ../libvips/conversion/ifthenelse.c:417 #: ../libvips/conversion/ifthenelse.c:490
msgid "blend" msgid "blend"
msgstr "" msgstr ""
#: ../libvips/conversion/ifthenelse.c:418 #: ../libvips/conversion/ifthenelse.c:491
msgid "Blend smoothly between then and else parts" msgid "Blend smoothly between then and else parts"
msgstr "" msgstr ""
@ -1429,7 +1429,7 @@ msgstr ""
msgid "error reading radiance header" msgid "error reading radiance header"
msgstr "" msgstr ""
#: ../libvips/foreign/radiance.c:959 ../libvips/foreign/tiff2vips.c:1331 #: ../libvips/foreign/radiance.c:959 ../libvips/foreign/tiff2vips.c:1343
msgid "read error" msgid "read error"
msgstr "" msgstr ""
@ -1709,91 +1709,91 @@ msgstr ""
msgid "EXR error: %s" msgid "EXR error: %s"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:262 ../libvips/foreign/tiff2vips.c:285 #: ../libvips/foreign/tiff2vips.c:265 ../libvips/foreign/tiff2vips.c:288
#: ../libvips/foreign/tiff2vips.c:303 #: ../libvips/foreign/tiff2vips.c:306
#, c-format #, c-format
msgid "required field %d missing" msgid "required field %d missing"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:266 #: ../libvips/foreign/tiff2vips.c:269
#, c-format #, c-format
msgid "required field %d=%d, not %d" msgid "required field %d=%d, not %d"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:650 #: ../libvips/foreign/tiff2vips.c:653
#, c-format #, c-format
msgid "%d bits per sample palette image not supported" msgid "%d bits per sample palette image not supported"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:659 #: ../libvips/foreign/tiff2vips.c:662
msgid "bad colormap" msgid "bad colormap"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:716 ../libvips/foreign/tiff2vips.c:747 #: ../libvips/foreign/tiff2vips.c:719 ../libvips/foreign/tiff2vips.c:750
msgid "3 or 4 bands RGB TIFF only" msgid "3 or 4 bands RGB TIFF only"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:818 #: ../libvips/foreign/tiff2vips.c:821
msgid "4 or 5 bands CMYK TIFF only" msgid "4 or 5 bands CMYK TIFF only"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:869 #: ../libvips/foreign/tiff2vips.c:872
msgid "unknown resolution unit" msgid "unknown resolution unit"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:874 #: ../libvips/foreign/tiff2vips.c:877
#, c-format #, c-format
msgid "" msgid ""
"no resolution information for TIFF image \"%s\" -- defaulting to 1 pixel per " "no resolution information for TIFF image \"%s\" -- defaulting to 1 pixel per "
"mm" "mm"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:946 #: ../libvips/foreign/tiff2vips.c:949
#, c-format #, c-format
msgid "unsupported sample format %d for lab image" msgid "unsupported sample format %d for lab image"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:956 #: ../libvips/foreign/tiff2vips.c:959
#, c-format #, c-format
msgid "unsupported depth %d for LAB image" msgid "unsupported depth %d for LAB image"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:995 #: ../libvips/foreign/tiff2vips.c:998
#, c-format #, c-format
msgid "unsupported sample format %d for greyscale image" msgid "unsupported sample format %d for greyscale image"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:1004 #: ../libvips/foreign/tiff2vips.c:1007
#, c-format #, c-format
msgid "unsupported depth %d for greyscale image" msgid "unsupported depth %d for greyscale image"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:1052 #: ../libvips/foreign/tiff2vips.c:1055
#, c-format #, c-format
msgid "unsupported sample format %d for rgb image" msgid "unsupported sample format %d for rgb image"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:1061 #: ../libvips/foreign/tiff2vips.c:1064
#, c-format #, c-format
msgid "unsupported depth %d for RGB image" msgid "unsupported depth %d for RGB image"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:1075 #: ../libvips/foreign/tiff2vips.c:1078
#, c-format #, c-format
msgid "unknown photometric interpretation %d" msgid "unknown photometric interpretation %d"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:1444 #: ../libvips/foreign/tiff2vips.c:1456
#, c-format #, c-format
msgid "bad page number %d" msgid "bad page number %d"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:1465 ../libvips/foreign/vips2tiff.c:286 #: ../libvips/foreign/tiff2vips.c:1477 ../libvips/foreign/vips2tiff.c:289
#, c-format #, c-format
msgid "unable to open \"%s\" for input" msgid "unable to open \"%s\" for input"
msgstr "" msgstr ""
#: ../libvips/foreign/tiff2vips.c:1520 ../libvips/foreign/tiff2vips.c:1550 #: ../libvips/foreign/tiff2vips.c:1532 ../libvips/foreign/tiff2vips.c:1562
#, c-format #, c-format
msgid "TIFF file does not contain page %d" msgid "TIFF file does not contain page %d"
msgstr "" msgstr ""
@ -1932,44 +1932,44 @@ msgstr ""
msgid "save image to png buffer" msgid "save image to png buffer"
msgstr "" msgstr ""
#: ../libvips/foreign/vips2tiff.c:270 #: ../libvips/foreign/vips2tiff.c:273
#, c-format #, c-format
msgid "unable to open \"%s\" for output" msgid "unable to open \"%s\" for output"
msgstr "" msgstr ""
#: ../libvips/foreign/vips2tiff.c:692 #: ../libvips/foreign/vips2tiff.c:695
msgid "layer buffer exhausted -- try making TIFF output tiles smaller" msgid "layer buffer exhausted -- try making TIFF output tiles smaller"
msgstr "" msgstr ""
#: ../libvips/foreign/vips2tiff.c:922 #: ../libvips/foreign/vips2tiff.c:926
msgid "TIFF write tile failed" msgid "TIFF write tile failed"
msgstr "" msgstr ""
#: ../libvips/foreign/vips2tiff.c:998 #: ../libvips/foreign/vips2tiff.c:1002
msgid "internal error #9876345" msgid "internal error #9876345"
msgstr "" msgstr ""
#: ../libvips/foreign/vips2tiff.c:1251 #: ../libvips/foreign/vips2tiff.c:1255
msgid "tile size not a multiple of 16" msgid "tile size not a multiple of 16"
msgstr "" msgstr ""
#: ../libvips/foreign/vips2tiff.c:1257 #: ../libvips/foreign/vips2tiff.c:1261
msgid "can't have strip pyramid -- enabling tiling" msgid "can't have strip pyramid -- enabling tiling"
msgstr "" msgstr ""
#: ../libvips/foreign/vips2tiff.c:1268 #: ../libvips/foreign/vips2tiff.c:1272
msgid "can only pyramid LABQ and non-complex images" msgid "can only pyramid LABQ and non-complex images"
msgstr "" msgstr ""
#: ../libvips/foreign/vips2tiff.c:1285 #: ../libvips/foreign/vips2tiff.c:1289
msgid "can't have 1-bit JPEG -- disabling JPEG" msgid "can't have 1-bit JPEG -- disabling JPEG"
msgstr "" msgstr ""
#: ../libvips/foreign/vips2tiff.c:1463 #: ../libvips/foreign/vips2tiff.c:1479
msgid "unsigned 8-bit int, 16-bit int, and 32-bit float only" msgid "unsigned 8-bit int, 16-bit int, and 32-bit float only"
msgstr "" msgstr ""
#: ../libvips/foreign/vips2tiff.c:1470 #: ../libvips/foreign/vips2tiff.c:1486
msgid "1 to 5 bands only" msgid "1 to 5 bands only"
msgstr "" msgstr ""
@ -2237,7 +2237,7 @@ msgstr ""
msgid "usage:" msgid "usage:"
msgstr "" msgstr ""
#: ../libvips/iofuncs/operation.c:287 ../libvips/iofuncs/object.c:1248 #: ../libvips/iofuncs/operation.c:287 ../libvips/iofuncs/object.c:1239
#: ../libvips/resample/interpolate.c:615 #: ../libvips/resample/interpolate.c:615
#, c-format #, c-format
msgid "class \"%s\" not found" msgid "class \"%s\" not found"
@ -2897,56 +2897,56 @@ msgstr ""
msgid "parameter %s not set" msgid "parameter %s not set"
msgstr "" msgstr ""
#: ../libvips/iofuncs/object.c:505 #: ../libvips/iofuncs/object.c:500
#, c-format #, c-format
msgid "no property named `%s'" msgid "no property named `%s'"
msgstr "" msgstr ""
#: ../libvips/iofuncs/object.c:513 #: ../libvips/iofuncs/object.c:508
#, c-format #, c-format
msgid "no vips argument named `%s'" msgid "no vips argument named `%s'"
msgstr "" msgstr ""
#: ../libvips/iofuncs/object.c:520 #: ../libvips/iofuncs/object.c:515
#, c-format #, c-format
msgid "argument `%s' has no instance" msgid "argument `%s' has no instance"
msgstr "" msgstr ""
#: ../libvips/iofuncs/object.c:1297 #: ../libvips/iofuncs/object.c:1288
msgid "base class" msgid "base class"
msgstr "" msgstr ""
#: ../libvips/iofuncs/object.c:1311 #: ../libvips/iofuncs/object.c:1302
msgid "Nickname" msgid "Nickname"
msgstr "" msgstr ""
#: ../libvips/iofuncs/object.c:1312 #: ../libvips/iofuncs/object.c:1303
msgid "Class nickname" msgid "Class nickname"
msgstr "" msgstr ""
#: ../libvips/iofuncs/object.c:1318 #: ../libvips/iofuncs/object.c:1309
msgid "Description" msgid "Description"
msgstr "" msgstr ""
#: ../libvips/iofuncs/object.c:1319 #: ../libvips/iofuncs/object.c:1310
msgid "Class description" msgid "Class description"
msgstr "" msgstr ""
#: ../libvips/iofuncs/object.c:1509 #: ../libvips/iofuncs/object.c:1537
#, c-format #, c-format
msgid "enum '%s' has no member '%s'" msgid "enum '%s' has no member '%s'"
msgstr "" msgstr ""
#: ../libvips/iofuncs/object.c:1769 #: ../libvips/iofuncs/object.c:1797
#, c-format #, c-format
msgid "unable to set '%s'" msgid "unable to set '%s'"
msgstr "" msgstr ""
#: ../libvips/iofuncs/object.c:1777 #: ../libvips/iofuncs/object.c:1805
msgid "not , or ) after parameter" msgid "not , or ) after parameter"
msgstr "" msgstr ""
#: ../libvips/iofuncs/object.c:1784 #: ../libvips/iofuncs/object.c:1812
msgid "extra tokens after ')'" msgid "extra tokens after ')'"
msgstr "" msgstr ""
@ -3143,7 +3143,7 @@ msgstr ""
msgid "factor should be in [1,0)" msgid "factor should be in [1,0)"
msgstr "" msgstr ""
#: ../libvips/resample/im_shrink.c:346 #: ../libvips/resample/im_shrink.c:359
msgid "shrink factors should be >= 1" msgid "shrink factors should be >= 1"
msgstr "" msgstr ""