On 2011-12-23 01:59:11 -0500, Alexander Strange wrote:
> On Thu, Dec 22, 2011 at 3:22 PM, Janne Grunau <[email protected]> wrote:
> > Use sched_getaffinity to determine the number of logical CPUs.
> 
> Try sysconf(_SC_NPROCESSORS_ONLN), which exists on BSD too.

I started with sysconf, Mans suggested to to use sched_getaffinity()
instead since _SC_NPROCESSORS_ONLN or _SC_NPROC_ONLN are not standard
values.

sched_getaffinity() has the advantage of giving correct results when
the process runs only on a limited subset of cpu cores. For example
taskset -c 0 avconv ... won't use threaded en/decoding.

I guess it could make sense to add sysconf as fallback and for other
Unix systems.

> > Limits the number of threads to 16 since slice threading of H.264
> > seems to be buggy with more than 16 threads.
> 
> That would use an unreasonable amount of memory anyway.

Would it make sense to limit the number of threads also if manually
specified?

Janne
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to