groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Blake McBride <>
Subject Re: Re-entrant and multi-entrant Groovy calls
Date Fri, 20 Apr 2018 11:45:31 GMT
Thanks.  Speaking of Java alone, I understand that many Java API's are not
thread safe.  That's fine.  However, with respect to Java alone, I can have
any number of threads and so long as no thread touches the same
(application) variables at the same time, I'm always safe.

I understand that I must take this into account when using Groovy too.  My
problem is that I don't know if Groovy has some internal stuff that will
break even if I have no application variable problems.


Blake McBride

On Fri, Apr 20, 2018 at 6:34 AM, Jochen Theodorou <> wrote:

> Am 20.04.2018 um 11:21 schrieb Blake McBride:
>> 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.
> this is actually difficult to answer. The runtime system is designed to be
> safe for multi entrant usages (minus bugs of course). But just like in Java
> that does not mean all parts of the API are safe for this usage, not even
> groovy.lang
> bye Jochen

View raw message