Skip to content
  • Ell's avatar
    app: add gimp-parallel · 86b89cf6
    Ell authored
    Add gimp-parallel.[cc,h], which provides a set of parallel
    algorithms.
    
    These currently include:
    
      - gimp_parallel_distribute():  Calls a callback function in
        parallel on multiple threads, passing it the current thread
        index, and the total number of threads.  Allows specifying the
        maximal number of threads used.
    
      - gimp_parallel_distribute_range():  Splits a range of integers
        between multiple threads, passing the sub-range to a callback
        function.  Allows specifying the minimal sub-range size.
    
      - gimp_parallel_distribute_area():  Splits a rectangular area
        between multiple threads, passing the sub-area to a callback
        function.  Allows specifying the minimal sub-area.
    
    The callback function is passed using an appropriately-typed
    function pointer, and a user-data pointer.  Additionally, when used
    in a C++ file, each of the above functions has an overloaded
    template version, taking the callback through a generic parameter,
    without a user-data pointer, which allows using function objects.
    86b89cf6