Re: Porting Rubi

Gunter K�nigsmann via Maxima-discuss <[email protected]> Fri, 17 Jul 2026 06:59:59 +0200
Newsgroups gmane.comp.mathematics.maxima.general
Message-ID <[email protected]>
--===============4457504936028363268==
Content-Type: multipart/alternative;
 boundary=----OOX9M2IT3122MR4DMZ3OILEULFFLA1
Content-Transfer-Encoding: 7bit

------OOX9M2IT3122MR4DMZ3OILEULFFLA1
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

Typically there is no way to force-close a thread from the outside=2E That =
means if you don't have a good method to tell one thread to check a global =
flag on regular intervals and to terminate quickly if that flag is set you =
cannot use them in a race towards a goal=2E=20

There is one precondition for successfully using threads for doing work in=
 parallel: each thread must avoid to change global flags that unexpectedly =
alters the conditions another thread operates in=2E=20
Currently Maxima loves global flags=2E Often it does do so locally from a =
(let ), but I expect many functions not to be thread-safe, currently, becau=
se they really change global variables=2E=20

Kind regards,=20

   Gunter=20


On 17 July 2026 01:24:37 CEST, Dan Stanger <dan=2Estanger=2E850@gmail=2Eco=
m> wrote:
>Rocky said that some of the paths might never terminate=2E
>
>On Thu, Jul 16, 2026, 7:17=E2=80=AFPM Raymond Toy <toy=2Eraymond@gmail=2E=
com> wrote:
>
>> On 7/16/26 2:57 PM, Dan Stanger wrote:
>>
>> I had a discussion with Rocky in NYC who works on the Mathics Rubi code=
,
>> and he pointed out that Rubi starts multiple pattern matching threads a=
nd
>> when one of them finishes by matching, the others are terminated=2E In =
which
>> lisps is this implementable ?
>>
>> Presumably sbcl=2E Maybe ccl and ecl?
>>
>> So the first one to finish is considered the right answer? Seems kinda
>> odd=2E It seems that for some integrals you can get different results
>> depending on which finishes first? Presumably they=E2=80=99re equivalen=
t?
>>
>> I certainly wouldn=E2=80=99t want answers that could vary by chance=2E
>>
>> Isn=E2=80=99t this just an optimization so it doesn=E2=80=99t take a lo=
ng time to find a
>> pattern that matches?
>> &#8203;
>> _______________________________________________
>> Maxima-discuss mailing list
>> Maxima-discuss@lists=2Esourceforge=2Enet
>> https://lists=2Esourceforge=2Enet/lists/listinfo/maxima-discuss
>>

------OOX9M2IT3122MR4DMZ3OILEULFFLA1
Content-Type: text/html;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head></head><body><div dir=3D"auto">Typically there is no way to for=
ce-close a thread from the outside=2E That means if you don't have a good m=
ethod to tell one thread to check a global flag on regular intervals and to=
 terminate quickly if that flag is set you cannot use them in a race toward=
s a goal=2E <br><br>There is one precondition for successfully using thread=
s for doing work in parallel: each thread must avoid to change global flags=
 that unexpectedly alters the conditions another thread operates in=2E <br>=
Currently Maxima loves global flags=2E Often it does do so locally from a (=
let ), but I expect many functions not to be thread-safe, currently, becaus=
e they really change global variables=2E <br><br>Kind regards, <br><br>=C2=
=A0=C2=A0 Gunter <br></div><br><br><div class=3D"gmail_quote"><div dir=3D"a=
uto">On 17 July 2026 01:24:37 CEST, Dan Stanger &lt;dan=2Estanger=2E850@gma=
il=2Ecom&gt; wrote:</div><blockquote class=3D"gmail_quote" style=3D"margin:=
 0pt 0pt 0pt 0=2E8ex; border-left: 1px solid rgb(204, 204, 204); padding-le=
ft: 1ex;">
<div dir=3D"auto">Rocky said that some of the paths might never terminate=
=2E</div><br><div class=3D"gmail_quote gmail_quote_container"><div dir=3D"l=
tr" class=3D"gmail_attr">On Thu, Jul 16, 2026, 7:17=E2=80=AFPM Raymond Toy =
&lt;<a href=3D"mailto:toy=2Eraymond@gmail=2Ecom">toy=2Eraymond@gmail=2Ecom<=
/a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0=
 0 0 =2E8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>

 =20

   =20
   =20
   =20
 =20
  <div>
    <div>
      <p style=3D"margin-bottom:19=2E2px;margin-top:0px">On 7/16/26 2:57
        PM, Dan Stanger wrote:<br>
      </p>
      <blockquote type=3D"cite" style=3D"border-bottom-color:rgb(119,119,1=
19);border-left:2px solid rgb(114,159,207);border-right-color:rgb(119,119,1=
19);border-top-color:rgb(119,119,119);color:rgb(119,119,119);column-rule-co=
lor:rgb(119,119,119);margin:19=2E2px 0px;outline-color:rgb(119,119,119);pad=
ding-left:16px;padding-right:16px;quotes:none;text-decoration-color:rgb(119=
,119,119);text-emphasis-color:rgb(119,119,119)">
        <div dir=3D"auto">I had a discussion with Rocky in NYC who works
          on the Mathics Rubi code, and he pointed out that Rubi starts
          multiple pattern matching threads and when one of them
          finishes by matching, the others are terminated=2E In which
          lisps is this implementable ?</div>
      </blockquote>
      Presumably sbcl=2E Maybe ccl and ecl?
      <p style=3D"margin-bottom:19=2E2px;margin-top:0px">So the first
        one to finish is considered the right answer? Seems kinda odd=2E
        It seems that for some integrals you can get different results
        depending on which finishes first? Presumably they=E2=80=99re
        equivalent?</p>
      <p style=3D"margin-bottom:19=2E2px;margin-top:0px">I certainly
        wouldn=E2=80=99t want answers that could vary by chance=2E</p>
      <p style=3D"margin-bottom:19=2E2px;margin-top:0px">Isn=E2=80=99t thi=
s just
        an optimization so it doesn=E2=80=99t take a long time to find a p=
attern
        that matches?</p>
    </div>
    <div style=3D"height:0;width:0;max-height:0;max-width:0;overflow:hidde=
n;font-size:0;padding:0;margin:0" aria-hidden=3D"true" title=3D"MDH:PGJyPjx=
icj48ZGl2IGNsYXNzPSJtb3otY2l0ZS1wcmVmaXgiPk9uIDcvMTYvMjYgMjo1NyBQTSwgRGFuIF=
N0YW5nZXIgd3JvdGU6PGJyPjwvZGl2PjxibG9ja3F1b3RlIHR5cGU9ImNpdGUiIGNpdGU9Im1pZ=
DpDQUZ5aHRUNWhCd0N3NVhPZGVocGozdzVySzBMK2FVcE4zMkI4VjMrPWFOejVMaTBMUXdAbWFp=
bC5nbWFpbC5jb20iPgo8bWV0YSBodHRwLWVxdWl2PSJjb250ZW50LXR5cGUiIGNvbnRlbnQ9InR=
leHQvaHRtbDsgIj48ZGl2IGRpcj0iYXV0byI+SSBoYWQgYSBkaXNjdXNzaW9uIHdpdGggUm9ja3=
kgaW4gTllDIHdobyB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MDAwOyIgY29udGVudGVkaXRhYmxlPSJmYWxzZSIgcG9wb3Zlcj0iYXV0byI+PC91bD4=3D"=
>&amp;#8203;</div>
  </div>

_______________________________________________<br>
Maxima-discuss mailing list<br>
<a href=3D"mailto:Maxima-discuss@lists=2Esourceforge=2Enet" target=3D"_bla=
nk" rel=3D"noreferrer">Maxima-discuss@lists=2Esourceforge=2Enet</a><br>
<a href=3D"https://lists=2Esourceforge=2Enet/lists/listinfo/maxima-discuss=
" rel=3D"noreferrer noreferrer" target=3D"_blank">https://lists=2Esourcefor=
ge=2Enet/lists/listinfo/maxima-discuss</a><br>
</blockquote></div>
</blockquote></div></body></html>
------OOX9M2IT3122MR4DMZ3OILEULFFLA1--


--===============4457504936028363268==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============4457504936028363268==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Maxima-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maxima-discuss

--===============4457504936028363268==--