[graalvm-users] Testing polyglot libs

Benoit Daloze eregontp at gmail.com
Thu Jun 14 11:59:51 PDT 2018


Indeed, we'd like to allow such a scenario and we are trying to figure out
how to make this work and still be safe.

One interesting question is: what should happen if R is called from another
Ruby thread?

If you have a precise use-case in mind, could you post an issue on
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_oracle_graal_issues&d=DwIFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=CUkXBxBNT_D5N6HMJ5T9Z6rmvNKYsqupcbk72K0lcoQ&m=eIKRxCfjRcPMjxzcKW-CNvr62jScX8JoU1y-LOB6chk&s=pmPiv8Wq5RWl6BK5V1BzJxuAYi_v1F9WvWEuJvmKgGM&e= to track it more easily?

On Thu, Jun 14, 2018 at 7:44 PM, Rodrigo Botafogo <
rodrigo.a.botafogo at gmail.com> wrote:

> Thanks Benoit!
>
> Now, is it really necessary to prevent multithreaded when interfacing Ruby
> and R?  I understand that since R is not multithreaded, calling it from
> multiple threads will cause weird problems, but if the programmer is
> careful and say, only calls R from the same Ruby thread, everything should
> work fine, no?  If this is the case, then could there be a flag to allow
> multithreaded applications even in the presence of R?
>
> Thanks
>
>
> On Thu, Jun 14, 2018 at 2:38 PM Benoit Daloze <eregontp at gmail.com> wrote:
>
>> Note that one way to avoid MinitTest creating multiple threads is to give
>> it `N=0` like
>>
>> $ N=0 ruby -Xsingle_threaded=true mytest.rb
>>
>> I checked and this seems to work fine with GraalVM RC2 and minitest
>> 5.10.1 (bundled) and 5.11.3 (latest).
>>
>> On Thu, Jun 14, 2018 at 5:25 PM, Rodrigo Botafogo <
>> rodrigo.a.botafogo at gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I'm trying to set up testing for my polyglot lib and I'm having a hard
>>> time.  Sorry if I should post somewhere else...
>>>
>>> So I tried to test with rspec, but rspec will run ruby somehow and does
>>> not pass to ruby the --polyglot --jvm flags.  Polyglot complains that R is
>>> not a known language.  I've googled around and could not find an easy way
>>> to make rspec pass flags to ruby.
>>>
>>> Next I tried minitest, since in this case I call ruby directly with the
>>> required flags... but polyglot complains that R cannot execute in
>>> multithreaded, so I passed -Xsingle_threaded to ruby and minitest complains
>>> that it only runs in a multithreaded environment.
>>>
>>> Any suggestions how to move forward?
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>>
>>> --
>>> Rodrigo Botafogo
>>>
>>> _______________________________________________
>>> GraalVM-Users mailing list
>>> GraalVM-Users at oss.oracle.com
>>> https://oss.oracle.com/mailman/listinfo/graalvm-users
>>>
>>
>>
>
> --
> Rodrigo Botafogo
> Integrando TI ao seu negócio
> 21-3010-4802/11-3010-1802
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/graalvm-users/attachments/20180614/d09d0bf3/attachment.html 


More information about the GraalVM-Users mailing list