Re: Evaluator.compile() thread safe
"Konstantin L. Metlov" <[email protected]> Tue, 12 Jun 2018 16:42:19 +0300
| Newsgroups | gmane.comp.java.jel.general |
|---|---|
| Message-ID | <[email protected]> |
These methods perform a static initialization during the Evaluator class
loading and the initialized variables are then used in read-only fashion.
Basically, they initialize the ClassFile object and keep a copy, which is
then cloned for each compiled expression to avoid initializing it again
and again.
So, the short answer -- it should not break thread safety IMHO.
I remember to have introduced synchronization into JEL class loader to fix
a race condition, exposed in a heavily threaded environment. This means
that the rest of the code was fine.
With the best regards,
Konstantin.
> Hi,
>
> There are some static fields in class Evaluator. Do these affect
compile(...) method with respect to thread safety?
>
> Regards,
> Alexei
>
>