Re: Porting Rubi
Richard Fateman <[email protected]> Fri, 17 Jul 2026 08:29:10 +0000
| Newsgroups | gmane.comp.mathematics.maxima.general |
|---|---|
| Message-ID | <CADB8Zm7E3SwHSAxW-Ooy4SnevE08mumsMiErug1h1HfYF24ngw@mail.gmail.com> |
--===============0485132894397310582== Content-Type: multipart/alternative; boundary="0000000000008074560656ca5a6e" --0000000000008074560656ca5a6e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mathematica rules and pattern matching are specified sequentially, i thought. How does Rubi do parallel processing? On Fri, Jul 17, 2026, 5:00=E2=80=AFAM Gunter K=EF=BF=BDnigsmann via Maxima-= discuss < [email protected]> wrote: > Typically there is no way to force-close a thread from the outside. That > means if you don't have a good method to tell one thread to check a globa= l > flag on regular intervals and to terminate quickly if that flag is set yo= u > cannot use them in a race towards a goal. > > There is one precondition for successfully using threads for doing work i= n > parallel: each thread must avoid to change global flags that unexpectedly > alters the conditions another thread operates in. > Currently Maxima loves global flags. Often it does do so locally from a > (let ), but I expect many functions not to be thread-safe, currently, > because they really change global variables. > > Kind regards, > > Gunter > > > On 17 July 2026 01:24:37 CEST, Dan Stanger <[email protected]> > wrote: > >> Rocky said that some of the paths might never terminate. >> >> On Thu, Jul 16, 2026, 7:17=E2=80=AFPM Raymond Toy <[email protected]= > 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. In wh= ich >>> lisps is this implementable ? >>> >>> Presumably sbcl. Maybe ccl and ecl? >>> >>> So the first one to finish is considered the right answer? Seems kinda >>> odd. 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. >>> >>> 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? >>> ​ >>> _______________________________________________ >>> Maxima-discuss mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/maxima-discuss >>> >> _______________________________________________ > Maxima-discuss mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > --0000000000008074560656ca5a6e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto"><div>Mathematica rules and pattern matching are specified= sequentially, i thought. How does Rubi do parallel processing?<div dir=3D"= auto"><br></div><div dir=3D"auto"><br></div><br><br><div class=3D"gmail_quo= te gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jul= 17, 2026, 5:00=E2=80=AFAM Gunter K=EF=BF=BDnigsmann via Maxima-discuss <= ;<a href=3D"mailto:[email protected]">maxima-discuss@lis= ts.sourceforge.net</a>> wrote:<br></div><blockquote class=3D"gmail_quote= " style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);= padding-left:1ex"><div><div dir=3D"auto">Typically there is no way to force= -close a thread from the outside. 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. <br><br>There is one precondition for successfully using threads = for doing work in parallel: each thread must avoid to change global flags t= hat unexpectedly alters the conditions another thread operates in. <br>Curr= ently Maxima loves global flags. Often it does do so locally from a (let ),= but I expect many functions not to be thread-safe, currently, because they= really change global variables. <br><br>Kind regards, <br><br>=C2=A0=C2=A0= Gunter <br></div><br><br><div class=3D"gmail_quote"><div dir=3D"auto">On 1= 7 July 2026 01:24:37 CEST, Dan Stanger <<a href=3D"mailto:dan.stanger.85= [email protected]" target=3D"_blank" rel=3D"noreferrer">[email protected]= </a>> wrote:</div><blockquote class=3D"gmail_quote" style=3D"margin:0pt = 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <div dir=3D"auto">Rocky said that some of the paths might never terminate.<= /div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">O= n Thu, Jul 16, 2026, 7:17=E2=80=AFPM Raymond Toy <<a href=3D"mailto:toy.= [email protected]" target=3D"_blank" rel=3D"noreferrer">[email protected]= om</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margi= n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex= "><u></u> =20 =20 =20 =20 =20 <div> <div> <p style=3D"margin-bottom:19.2px;margin-top:0px">On 7/16/26 2:57 PM, Dan Stanger wrote:<br> </p> <blockquote type=3D"cite" style=3D"border-color:rgb(119,119,119) rgb(= 119,119,119) rgb(119,119,119) rgb(114,159,207);border-left-width:2px;border= -left-style:solid;color:rgb(119,119,119);column-rule-color:rgb(119,119,119)= ;margin:19.2px 0px;outline-color:rgb(119,119,119);padding-left:16px;padding= -right:16px;quotes:none;text-decoration-color:rgb(119,119,119);text-emphasi= s-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. In which lisps is this implementable ?</div> </blockquote> Presumably sbcl. Maybe ccl and ecl? <p style=3D"margin-bottom:19.2px;margin-top:0px">So the first one to finish is considered the right answer? Seems kinda odd. 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.2px;margin-top:0px">I certainly wouldn=E2=80=99t want answers that could vary by chance.</p> <p style=3D"margin-bottom:19.2px;margin-top:0px">Isn=E2=80=99t this j= ust an optimization so it doesn=E2=80=99t take a long time to find a pa= ttern that matches?</p> </div> <div style=3D"height:0px;width:0px;max-height:0px;max-width:0px;overflo= w:hidden;font-size:0px;padding:0px;margin:0px" aria-hidden=3D"true" title= =3D"MDH:PGJyPjxicj48ZGl2IGNsYXNzPSJtb3otY2l0ZS1wcmVmaXgiPk9uIDcvMTYvMjYgMjo= 1NyBQTSwgRGFuIFN0YW5nZXIgd3JvdGU6PGJyPjwvZGl2PjxibG9ja3F1b3R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B0aGlzIGp1c3QgYW4g= b3B0aW1pemF0aW9uIHNvIGl0IGRvZXNuJ3QgdGFrZSBhIGxvbmcgdGltZSB0byBmaW5kIGEgcGF= 0dGVybiB0aGF0IG1hdGNoZXM/PGJyPjxicj48dWwgY2xhc3M9ImRyb3Bkb3duLW1lbnUgdGV4dG= NvbXBsZXRlLWRyb3Bkb3duIiBzdHlsZT0iZGlzcGxheTogbm9uZTsgcG9zaXRpb246IGFic29sd= XRlOyB6LWluZGV4OiAxMDAwOyIgY29udGVudGVkaXRhYmxlPSJmYWxzZSIgcG9wb3Zlcj0iYXV0= byI+PC91bD4=3D">&#8203;</div> </div> _______________________________________________<br> Maxima-discuss mailing list<br> <a href=3D"mailto:[email protected]" rel=3D"noreferrer n= oreferrer" target=3D"_blank">[email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/maxima-discuss" rel= =3D"noreferrer noreferrer noreferrer" target=3D"_blank">https://lists.sourc= eforge.net/lists/listinfo/maxima-discuss</a><br> </blockquote></div> </blockquote></div></div>_______________________________________________<br= > Maxima-discuss mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank" r= el=3D"noreferrer">[email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/maxima-discuss" rel= =3D"noreferrer noreferrer" target=3D"_blank">https://lists.sourceforge.net/= lists/listinfo/maxima-discuss</a><br> </blockquote></div></div></div> --0000000000008074560656ca5a6e-- --===============0485132894397310582== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============0485132894397310582== 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 --===============0485132894397310582==--