[x265] [PATCH 2 of 2] threadpool: fix calculation of JobProviders
Steve Borho
steve at borho.org
Mon Aug 3 17:14:05 CEST 2015
On 07/27, deepthi at multicorewareinc.com wrote:
> # HG changeset patch
> # User Deepthi Nandakumar <deepthi at multicorewareinc.com>
> # Date 1437986236 -19800
> # Mon Jul 27 14:07:16 2015 +0530
> # Node ID dc446bc5df507d857c3f72ba595a95e981c0258d
> # Parent eb6b04fc06a37a0cfbc70d30f364ec62cbb909d4
> threadpool: fix calculation of JobProviders
>
> The framethreads are assigned in a round robin fashion to all threadpools. The
> lookahead is always assigned to threadpool 0. This patch fixes crashes due to
> under allocation of job providers to thread pool 0.
>
> diff -r eb6b04fc06a3 -r dc446bc5df50 source/common/threadpool.cpp
> --- a/source/common/threadpool.cpp Mon Jul 27 13:00:17 2015 +0530
> +++ b/source/common/threadpool.cpp Mon Jul 27 14:07:16 2015 +0530
> @@ -310,7 +310,7 @@
> ThreadPool *pools = new ThreadPool[numPools];
> if (pools)
> {
> - int maxProviders = (p->frameNumThreads + 1 + numPools - 1) / numPools; /* +1 is Lookahead */
> + int maxProviders = (p->frameNumThreads + numPools - 1) / numPools + 1; /* +1 is Lookahead, always assigned to threadpool 0*/
good catch
> int node = 0;
> for (int i = 0; i < numPools; i++)
> {
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
--
Steve Borho
More information about the x265-devel
mailing list