Sujet : <parallel> Ant Task doesn't need threads (Was: Time Sharing: Martin Richards, Ken Thompson and Linus Torvalds)
De : janburse (at) *nospam* fastmail.fm (Mild Shock)
Groupes : comp.lang.prologDate : 19. Jun 2025, 13:54:20
Autres entêtes
Message-ID : <103119s$10k4j$1@solani.org>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0 SeaMonkey/2.53.21
Hi,
I find fewer and fewer use cases for threads.
Here some fun with <parallel> Ant Task:
<target name="dogelog_transpile">
<parallel>
<ant dir="../player/cross"
antfile="run.xml"/>
<ant dir="../playerpy/cross"
antfile="run.xml"/>
<ant dir="../playerj/cross"
antfile="run.xml"/>
</parallel>
</target>
Transpiling Dogelog Player in parallel. Except
for a totally broken Ant log file, works
smooth and shows a solid speed up. Although everything
is heavily forked and possibly processes. I assume
Ant offers tries to use threads, back from the time
Java people were proud of their threads,
but it nowadays with high speed solid state disks
and large memory capacity, it doesn't make a dent anymore.
LoL
Bye
P.S.: No GitHub Actions nonsense allowed here. Although
matrix build looks interesting. Its possibly to uniform
paralleliz. Unfortunately I have cases where I mix <parallel>
with <sequential> in ant task. And for the lazy ones there
is <macrodef> . What I didn't try yet is a better logger,
it seems Gradel would provide that? One could have a DOM
as Log datastructure, before the log gets committed.
Simulating the mailboxes of SWI-Prolog message system.
But the idea of "mailboxes" already indicate messages would
leave process borders. Thank god I have delegated everything
to Ant, don't need to make my hands dirty here.
Mild Shock schrieb:
Hi,
Threads are just a variant of processes that
share a heap, which can be the bottleneck. Processes
are good for time sharing systems. Some history:
How it started, support small CPUs:
TRIPOS (TRIvial Portable Operating System)
https://en.wikipedia.org/wiki/TRIPOS
How it is going, more small CPUs excitement:
The Origins of Linux—Linus Torvalds
https://www.youtube.com/watch?v=WVTWCPoUt8w
But what about GUI programming, or even web
servers database access? Threads have massively
fallen back with other models mainly through
JavaScript, in the GUI via the browser and
on the server via node.js. So don't be fooled
by multi-threading Prolog systems,
could be a complete nonsense...
Mild Shock schrieb:
>
I wasted a half dozen months with simulated
“threads” by using CheerpJ. This was a very
interesting experience, I could run formerly
Jekejeke Prolog written in Java inside JavaScript.
>
Main problem a simulation of “threads” cannot
use certain GUI programming patterns from
JavaScript. Because then you have still pre-emptive
yield, like if you do it with auto-yield.
>
But in JavaScript you have critical regions
for free, just between two awaits, there will
be no yield. Such properties might impact how
you model your “concurrent” logic.
>
This puts some weight on having a shield/1
primitive. The CheerpJ threads were not that
bad, I added auto yield, but shield/1 is a
later invention from Dogelog Player.
>
Mild Shock schrieb:
Hi,
>
When did the quantum leap happen in Dogelog Player?
Well very early on: The first binary release was here:
>
ANN: Dogelog Player 0.9.7
The new version 0.9.7 of the Dogelog
player now masters DCG.
Admin User, created 09/06/2025
>
And '$YIELD'/1 stuff came 9 months (sic!) later:
>
ANN: Dogelog Player 0.9.8
The Dogelog Player supports a new interpreter
that can relinquish control.
Admin User, created 21/03/2022
>
See for your self:
>
https://www.xlog.ch/izytab/doclet/home/12_news/package.html
>
9 months, like Homo sapiens gestation period. (*)
>
LoL
>
Bye
>
(*) To be frank, it was the perfect pass time during
the COVID-19 pandemic.
>
Mild Shock schrieb:
Hi,
>
Somebody wrote:
>
> Right, but what I’m saying is that with the
> current implementation as a separate process,
> running independently of the editor and only
> communicating over the channel defined by the
> protocol, the ability to have fine-grained
> asynchronous communication is limited.
>
Not my problem not seeking the state of the art. You
need of course a Prolog system that is all flesh
and blood cooperative multitasking. If you want
>
to do a GUI in Prolog similar like JavaScript
does it now, or a native GUI adapter. And I don't
count Tau-Prolog, although they showed amazing
>
stuff. But not amazing enough, still based
on continuations, and not based on promises. Or then
async/await. I am not sure what SWI WASM now delivers?
>
SWI Tinker shows me errors talking about threads when
I use the query background execution feature and if I
abort. But people from cooperative multitasking tend
>
to not use the terminology "thread", they prefer to
talk about "tasks". Ciao Playground doesn't count either,
since their channels to a background worker can even
>
not process an interrupt correctly.
>
Bye
>
Mild Shock schrieb:
Hi,
>
The fukkers stole my name:
>
Jan - Local AI Assistant
https://github.com/menloresearch/jan
>
Bye
>
P.S.: Meanwhile I am struggling with Quantum Paper
whille doing a dark/light CSS. Look my light olive turned dark
olive, that is somewhere near chocolate or is it dog shit?
>
P.P.S.: Just figured out yesterday that some browser defaults
are more Motif/OSF than Material/Google, aka Quantum Paper.
>
>