Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Interesting. But I'm not seeing any parallelization and it's not immediately obvious how to implement that short of copy-pasting. Let's say I want to launch up to 32 instances of foo simultaneously and up to 8 instances of bar simultaneously, how would I do that? Commented Sep 12, 2020 at 7:42
  • Inside loop as for i in {1..32}; do ...; done where ... is "if" with foo and second one for i in {1..8} with "if" bar function, all process are going background, so it is pseudo parallelization, but works fine Commented Sep 12, 2020 at 9:26
  • Also this can be written as one liner ;) if you want, also... You can do "copy paste" version for shell (here bash) Commented Sep 12, 2020 at 9:35
  • Also as I think it should be possible to run foo and bar loops independent now main loop waiting for finish all background jobs Commented Sep 12, 2020 at 9:45
  • Ah, well, argumentless wait waits for all children. I see. This should superficially work, but doesn't really suit my problem because foo and bar have significantly different (and variable) performance. I'm afraid this won't be too efficient. Commented Sep 12, 2020 at 9:45