groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Blake McBride <blake1...@gmail.com>
Subject Re-entrant and multi-entrant Groovy calls
Date Fri, 20 Apr 2018 09:21:30 GMT
Greetings,

Does Groovy safely support re-entrant and multi-entrant calls?  What I mean
by that is the following:

Re-entrant:  on a single OS thread - my Java program calls into Groovy,
then Groovy calls into my Java application, and then the Java application
calls back into Groovy.  So the stack has Java, Groovy, JAVA, and then
Groovy again.

Multi-entrant:  my Java application has many threads.  One of my threads
calls into Groovy.  Then, while one thread is still in Groovy, another
thread evokes Groovy.  So now we have two calls into Groovy by two
independent Java/OS threads running at the same time.

I understand the typical problems associated with application-level shared
variables.  This is expected.  The question revolves around Groovy's
internals.  I presume Groovy may have some shared data that is internal to
Groovy.  That's what I am unclear about.  Groovy would have had to be
designed for these scenarios from the ground up.

This is a little hard to test because if it can't always correctly handle
these situations, it may not become clear until certain scenarios arrive.
It may be hard for any "test" program I write to cause those scenarios, so
I thought this may be a known answer.

Thanks!

Blake McBride

Mime
View raw message