<div dir="ltr">Yes, it makes perfect sense.<div>Actually we need that capability for mini_racer, where we want multiple JavaScript context from one Ruby context.</div><div><br></div><div>Could you file an issue on <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_oracle_graal_issues&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=CUkXBxBNT_D5N6HMJ5T9Z6rmvNKYsqupcbk72K0lcoQ&m=k7NRPYUa8hjmUxEjgM1rZa-K7Yt8fd_MlzBgZcYjifE&s=hJCnVwQXTVi6XYSKjhkjsNsQZRzY0vKyr3P7L26UrNs&e=">https://github.com/oracle/graal/issues</a> with what you just explained to track progress on this more easily?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 15, 2018 at 1:57 PM, Rodrigo Botafogo <span dir="ltr"><<a href="mailto:rodrigo.a.botafogo@gmail.com" target="_blank">rodrigo.a.botafogo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Benoit,</div><div><br></div><div>Actually, I think I have a pricise use case... let's say I'm building a Web Application that at some point might need to develop a data model for the user. In this case:</div><div></div><div><ul><li>I don't want my web application to be single threaded just because eventually I'll need to interface with R to build a data model;</li><li>Since building a data model is time usually consuming, then the best would be do have a worker thread take care of this model while not impacting user's interaction;</li><li>Since different users might request different models, it would be ideal if I could "instantiate" a new R for every users and run that on there own threads.</li></ul><div>Makes sense?</div><div><br></div></div></div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 14, 2018 at 4:54 PM Rodrigo Botafogo <<a href="mailto:rodrigo.a.botafogo@gmail.com" target="_blank">rodrigo.a.botafogo@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Benoit,<div><br></div><div>At this point I don't really have a precise use case. If there is a flag to force multithread and the user calls R from two threads, I think crashing would be the safest thing for R to do!</div><div><br></div><div>It just seems a very strong restriction to prevent the code from running just because there is an integration. Letting it run with an override flag would allow the use cases to appear.</div><div><br></div><div>Thanks! <br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 14, 2018 at 4:00 PM Benoit Daloze <<a href="mailto:eregontp@gmail.com" target="_blank">eregontp@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.<div><br></div><div>One interesting question is: what should happen if R is called from another Ruby thread?</div><div><br></div><div>If you have a precise use-case in mind, could you post an issue on <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_oracle_graal_issues&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=CUkXBxBNT_D5N6HMJ5T9Z6rmvNKYsqupcbk72K0lcoQ&m=k7NRPYUa8hjmUxEjgM1rZa-K7Yt8fd_MlzBgZcYjifE&s=hJCnVwQXTVi6XYSKjhkjsNsQZRzY0vKyr3P7L26UrNs&e=" target="_blank">https://github.com/oracle/<wbr>graal/issues</a> to track it more easily?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 14, 2018 at 7:44 PM, Rodrigo Botafogo <span dir="ltr"><<a href="mailto:rodrigo.a.botafogo@gmail.com" target="_blank">rodrigo.a.botafogo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Benoit!<div><br></div><div>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?</div><div><br></div><div>Thanks</div><div><br></div></div><div class="m_4278119263669253408m_2310368213622186268m_-7408151133736343006HOEnZb"><div class="m_4278119263669253408m_2310368213622186268m_-7408151133736343006h5"><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 14, 2018 at 2:38 PM Benoit Daloze <<a href="mailto:eregontp@gmail.com" target="_blank">eregontp@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Note that one way to avoid MinitTest creating multiple threads is to give it `N=0` like<div><br></div><div>$ N=0 ruby -Xsingle_threaded=true mytest.<wbr>rb</div><div><br></div><div>I checked and this seems to work fine with GraalVM RC2 and minitest 5.10.1 (bundled) and 5.11.3 (latest).</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 14, 2018 at 5:25 PM, Rodrigo Botafogo <span dir="ltr"><<a href="mailto:rodrigo.a.botafogo@gmail.com" target="_blank">rodrigo.a.botafogo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>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...</div><div><br></div><div>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. </div><div><br></div><div>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.</div><div><br></div><div>Any suggestions how to move forward?</div><div><br></div><div><br></div><div>Thanks</div><span class="m_4278119263669253408m_2310368213622186268m_-7408151133736343006m_8650703262678305573m_884301762383739274HOEnZb"><font color="#888888"><div><br></div><div><br></div><div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_4278119263669253408m_2310368213622186268m_-7408151133736343006m_8650703262678305573m_884301762383739274m_1500241590509904320gmail_signature">Rodrigo Botafogo<br></div></div></font></span></div>
<br>______________________________<wbr>_________________<br>
GraalVM-Users mailing list<br>
<a href="mailto:GraalVM-Users@oss.oracle.com" target="_blank">GraalVM-Users@oss.oracle.com</a><br>
<a href="https://oss.oracle.com/mailman/listinfo/graalvm-users" rel="noreferrer" target="_blank">https://oss.oracle.com/<wbr>mailman/listinfo/graalvm-users</a><br></blockquote></div><br></div>
</blockquote></div><br clear="all"><div><br></div></div></div><span class="m_4278119263669253408m_2310368213622186268m_-7408151133736343006HOEnZb"><font color="#888888">-- <br><div dir="ltr" class="m_4278119263669253408m_2310368213622186268m_-7408151133736343006m_8650703262678305573gmail_signature" data-smartmail="gmail_signature">Rodrigo Botafogo<br>Integrando TI ao seu negócio<br>21-3010-4802/11-3010-1802</div>
</font></span></blockquote></div><br></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_4278119263669253408m_2310368213622186268gmail_signature" data-smartmail="gmail_signature">Rodrigo Botafogo<br>Integrando TI ao seu negócio<br>21-3010-4802/11-3010-1802</div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="m_4278119263669253408gmail_signature" data-smartmail="gmail_signature">Rodrigo Botafogo<br>Integrando TI ao seu negócio<br>21-3010-4802/11-3010-1802</div>
</div></div></blockquote></div><br></div>