[Spice-devel] [spice] streaming: Use the optimal number of threads for VP8 encoding

Frediano Ziglio fziglio at redhat.com
Fri Nov 11 12:03:33 UTC 2016


> 
> > I'll also note that the h264 encoder automatically uses multiple
> > threads already so this patch only brings vp8enc in line with it.
> 
> After a quick look at x264, it seems to be using more threads than
> physiical CPUs. Is it ok too with vp8enc? I'd really like that we don't
> have that code invoking egrep as a fallback, ie no g_get_num_processors,
> no _SC_NPROCESSORS_ONLN, tough luck? (the latter is available on el6).
> 
> Christophe
> 

About getting the number of processors in the system looks like
nproc(1) uses sched_getaffinity followed by a CPU_COUNT on the
result. It's supported since kernel 2.5.8 and glibc 2.3.
Basically is equivalent to use sysconf(_SC_NPROCESSORS_ONLN).

Frediano


More information about the Spice-devel mailing list