ThreadContext.secureRandom

I was wondering, are ThreadContext objects getting reused ?

Even if they are, assuming I have several hundreds of Threads, with
JRuby
there will be a secureRandom final field created with every thread
context
instance,
https://github.com/jruby/jruby/blob/1.7.11/core/src/main/java/org/jruby/runtime/ThreadContext.java#L134right
?

I would like to know if this is an optimization done solely due
https://github.com/jruby/jruby/blob/1.7.11/core/src/main/java/org/jruby/ext/securerandom/SecureRandomLibrary.java
looking into security providers lately, using methods that consult all
installed providers (>= 9 by default) when “not needed” seems like best
to
be avoided (unless necessary).

I’d be happy to look into possibly refactoring this one, just wanted to
check if there’s another reason,
as this also might have a relation to some of the ‘BC’ internal
refactoring
to be finished up for OpenSSL.

Thanks, K.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs