Multiple globals using the same thread
Attila Szegedi
attila.szegedi at oracle.com
Mon Oct 13 07:48:10 UTC 2014
Globals don't have a thread affinity, but they're also not threadsafe (since JavaScript as a language isn't). This means that you can have multiple threads share one Global, but not concurrently; you'll need to provide synchronization around thread access to your Global, to make sure only one thread is using it at any given time.
Attila.
On Oct 12, 2014, at 9:07 PM, Serguei Mourachov <smourachov at gmail.com> wrote:
> We have a project where several thousands of script "instances" should be called/executed using limited number of threads.
> Is it possible to use multiple global objects invoking script functions from the same thread?
>
More information about the nashorn-dev
mailing list