From: Olivier Henley <olivier.henley@gmail.com>
Subject: 'Number_Of_CPUs' tasks creation, with discriminants, running simultaneously.
Date: Mon, 20 Jul 2020 06:51:12 -0700 (PDT) [thread overview]
Message-ID: <f3eac0d8-478d-492f-ab0b-17bd37e21095o@googlegroups.com> (raw)
Hi everyone,
My goal is to distribute similar work across multiple tasks. Incidentally, I want those tasks to start simultaneously, each task having some 'indexed' work (discriminants), and ideally block from main until they are done with their workload.
I got this working by declaring the tasks individually. What I would like to achieve is to leverage 'System.Multiprocessors.Number_Of_CPUs' for the number of tasks created. What is the idiomatic way of achieving what I want?
I tried with an array of tasks, but the problem becomes I do not know either how to start them simultaneously with parametrization or coordinate their exit point with main.
I am lurking for the most 'clean/simple' solution possible.
You can see the actual working code fixed at 8 tasks here:
https://github.com/ohenley/xph_covid19/blob/master/src/xph_covid19.adb#L280-L287
Thx, Olivier
next reply other threads:[~2020-07-20 13:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-20 13:51 Olivier Henley [this message]
2020-07-20 13:55 ` 'Number_Of_CPUs' tasks creation, with discriminants, running simultaneously Olivier Henley
2020-07-20 17:45 ` Jeffrey R. Carter
2020-07-20 20:31 ` Olivier Henley
2020-07-22 19:05 ` onox
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox