-
No. Jython collections, sets, and dictionaries are all based on java "Concurrent" underlying classes, so they are thread-safe, but algorithms built with them are not.
-
Yes. Java is highly multithreaded, so any thread waiting on a mutex could block actions that do not expect to wait (like the tag event thread pool).
-
Not in and of itself, no.
-
(Yeah, you didn't have "4".) The object returned from
system.util.getGlobals()
also holds top-level variables in gateway events. Yes, shared across the entire gateway. Access to those was/is part of its design. I created alternatives (nowsystem.util.globalVarMap()
in my Integration Toolkit) to avoid this particular complication. (There used to be more problems.)
Careful use of .setdefault
on Jython dictionaries, and .putIfAbsent()
on ConcurrentHashMap
s can reduce the need for mutexes or other locks. Consider this topic:
Related: If you always use one-liners in your gateway events that delegate to project library scripts, then you aren't creating any top-level variables that could clash with other residents of system.util.getGlobals()
.