That’s fair. Spawning tasks inside subprograms is something that should be done with a bit of care since the overhead can sometimes offset any gains, and the use of entries can easily create hard-to-debug deadlocks. Still, there are some situations where I’ve found it to be a useful tool, such as reading multiple large files at once. That’s a situation where you’d typically reach for async
/await
in another language, hitting the function coloring problem. Having tasks inside subprograms let’s you neatly encapsulate that.
That said, I’m not a terribly experienced Ada programmer, so it’s quite possible it is an anti-pattern.