<https://dev.lucee.org/t/switching-java-regex-engi...
# lucee
d
It's definitely not intuitive to me that the use of
<cfapplication />
is per-request, at least in the terms of updating the settings. I knew the settings were read on each request, but I just assumed trying to change something about the application settings would not be thread safe. That's good to know. @zackster Any idea how it affects code running in a thread?
z
good question, a thread runs as a child of the parent pageContext()
d
So switching the application settings like this for the regex engine, could break any threads that were spawned in the request that relied on regexes.
z
within the thread you are 100% safe
but when new threads child page context are created, they inherit what ever was running at the time
we are probably going to also add a
engine="java"
to the regex BIFs too
d
ok, so a thread clones the page context and doesn't use a reference. That's good to know too.
z
yep, which is why there's some overhead with threads