[PATCH] stdlib: Tuned down tst-arc4random-thread internal parameters

Florian Weimer fweimer@redhat.com
Wed Jul 27 12:25:38 GMT 2022


* Adhemerval Zanella:

>  static int
>  do_test (void)
>  {
> +  /* Do not run more threads than the maximum of online CPUs.  */
> +  long int cpus = sysconf (_SC_NPROCESSORS_ONLN);
> +  if (cpus != -1)
> +    /* Limit the number to not overload the system.  */
> +    outer_threads = (cpus / 2) / inner_threads;

Doesn't this make outer_threads on many systems?

By the way, I think we should switch to the standard arc4random_uniform
implementation that doesn't try to conserve bits.  It's cheaper to get a
larger number of bits once instead of obtaining 24 bits first, then 8
bits.

Thanks,
Florian



More information about the Libc-alpha mailing list