On Sun, Jun 19, 2016 at 11:52 AM, Charles Mills <[email protected]> wrote:

> Oh sure. The basic "wait for one of many." My code waits for an any one of
> an operator command, a timer expiration, or "real work."
>
> My question was does anyone issue a wait with a completion count of more
> than one? "Wake me when two of these five ECBs have been posted"?
>
> Charles
>
>
​That is a good question. I can think of a reason, as you said, to wait for
"1 of n". And I can think of a reason ​to wait for "n of n". I've even
thought of a reason to wait for what I'll call "1+1 of n" (i.e. what until
one specific ECB is posted, plus one of "n" other ECBs). The closest that I
can envision for "2 of n" might be if the "n" are "n" worker threads which
produce "some output" and, for some reason that I can't envision, the
parent needs at least 2 worker products in order to do something else. But
that idea is so vague that it is basically useless. Hum, maybe a case of
"efficiency" in the aforementioned scenario. Suppose that you need "n"
worker threads to produce "product". These thread each take a relatively
"large" amount of time. Your main thread does something with this
"product", but it does it quickly. It would be more efficient to accumulate
"m" (<n) units of "product" to process in a loop for each redispatch of the
main thread. Well, a little more reasonable, but still not too specific.


-- 
"Pessimism is a admirable quality in an engineer. Pessimistic people check
their work three times, because they're sure that something won't be right.
Optimistic people check once, trust in Solis-de to keep the ship safe, then
blow everyone up."
"I think you're mistaking the word optimistic for inept."
"They've got a similar ring to my ear."

>From "Star Nomad" by Lindsay Buroker:

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to