|
On 9/12/2011 11:16 AM, CRPence wrote:
If you try to handle every conceivable possibility, no simple
solution works (in my opinion, submitting a list of jobs to a
message queue handling job is not a simple solution). But a
little common sense would make it work for a specific situation.
In reality, for the vast majority of cases, the original as posted
would work fine. A simple tweak makes it NEARLY invincible, without
a lot of code: the last job in the list submits the job that
acquires the exclusive lock (after it gets its own read lock).
There is almost no conceivable way this could fail. <<SNIP>>
I would just use the MSGQ() and job completion messages as
specifically provided to detect when and how the submitted jobs
complete. I would probably pass the list of jobs [and the message
queue to monitor] as input to the final job, submitting that job
without delay, allowing that final job to do the polling awaiting
the completion messages for that list of jobs; allowing for the
submitter to continue doing something other than the polling for
completions.
I think it's a matter of personal style. Passing a list requires
maintaining that list every time a new job is ended or a job name
changes. Locking a data area works pretty well for me.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.