comp.lang.ada
 help / color / mirror / Atom feed
* 'Number_Of_CPUs' tasks creation, with discriminants, running simultaneously.
@ 2020-07-20 13:51 Olivier Henley
  2020-07-20 13:55 ` Olivier Henley
  2020-07-20 17:45 ` Jeffrey R. Carter
  0 siblings, 2 replies; 5+ messages in thread
From: Olivier Henley @ 2020-07-20 13:51 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-22 19:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 13:51 'Number_Of_CPUs' tasks creation, with discriminants, running simultaneously Olivier Henley
2020-07-20 13:55 ` Olivier Henley
2020-07-20 17:45 ` Jeffrey R. Carter
2020-07-20 20:31   ` Olivier Henley
2020-07-22 19:05     ` onox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox