[m-rev.] for post-commit review: document .par grades

Peter Wang novalazy at gmail.com
Wed Aug 20 14:10:53 AEST 2025


On Wed, 20 Aug 2025 13:37:14 +1000 Julien Fischer <jfischer at opturion.com> wrote:
> On Wed, 20 Aug 2025 at 13:10, Peter Wang <novalazy at gmail.com> wrote:
> 
> > I remembered something. On startup, LLDS .par grades will create a bunch
> > of threads for Mercury engines (by default, one for each hardware thread),
> > in preparation for running Mercury threads created with thread.spawn,
> > or to execute parallel conjuctions. Those engine threads will often
> > never be used because the program doesn't actually spawn non-native threads
> > or contain parallel conjuctions.
> >
> > It might be possible to defer creating Mercury engine threads until they
> > are actually needed, but it would need someone to make that effort.
> > I don't think there is any interest now.
> >
> > So, as an easier option, it *would* make sense to introduce a .mt grade
> > component for C grades that (unlike .par) supports multi-threading
> > but not non-native threads or parallel conjuction.
> 
> So with this proposal, in the grade asm_fast.mt.gc, spawn/3 would act
> identically to
> spawn_native/3?

Yes, then asm_fast.mt.gc would behave like hlc.mt.gc in that regard.

Peter


More information about the reviews mailing list