nashorn and threads...
Darren Cruse
darren.cruse at gmail.com
Tue Apr 16 12:35:32 PDT 2013
Apologies if this has been covered but I was wondering if there's
particular stance nashorn takes with regards to threads and blocking?
e.g. Regarding threads: I know that spawn and sync have been provided in
the Rhino shell, but not directly built into the Rhino javascript "language
proper" (so to speak).
Will nashorn likewise support spawn and sync in some fashion? (maybe the
answer like with Rhino is it doesn't have to take a stance it's more for
add ons to use java's threading from nashorn as they choose?)
And similarly regarding Node.jar and blocking: it seems like node's big
thing has been to argue for single-threaded non-blocking everything as it's
default.
Is the intent to match this philosophy with Node.jar? e.g. Does Node.jar
use e.g. Netty to match node's non-blocking singled threaded approach?
Of course there's also stuff like threads-a-go-go and server-side web
worker stuff for node - so one could implement those using java threads
outside the code of Node.jar...
So my real question here is whether the intent is to match node's semantics
with Node.jar, such that code would truly be portable between node.js and
Node.jar?
Or is there some thought to allow java's threading to be more central, i.e.
that Node.jar needn't be single threaded by default?
i.e. That Node.jar might work more like I'd experienced under RingoJS which
did use multi-threading and CommonJS blocking apis?
Thanks,
Darren
More information about the nashorn-dev
mailing list