[W32] Regarding slow startup under Windows
Timo Schulz
twoaday at gmx.net
Sun Apr 29 17:10:07 CEST 2007
Hi,
some time ago there was a thread about the startup time
of the random code which is implemented in Libgcrypt.
There might be an easy solution to speed up the process,
at least when the user does not want to gather random
entropy first. Threads and a simple mutex would do the job.
For example we could start the 'toolhelp32' snapshot or the
'query-perf-counter' function as a thread and maybe also other slow
gathering routines. Each function would lock a mutex at the begin and
unlocks it when the process is done.
If gcry_random_bytes() or another random function is called, it
first checks if the 'gather mutex' is unlocked, otherwise it will
wait until it is unlocked. With threads, there would be no delay at
the startup and the user can continue to use the public-key, mpi, sexp
and raw encryption API without waiting for the gathers.
Probably some other 'pool init' functions needs to be delayed also.
Timo
More information about the Gcrypt-devel
mailing list