> I don't know where I got the technique ... Probably JES2. I would have said HASP but CS/CDS wasn't available then.
> Date: Fri, 15 Apr 2011 18:01:24 -0400 > From: [email protected] > Subject: Re: Subtasking program > To: [email protected] > > IBM Mainframe Assembler List <[email protected]> wrote on > 04/15/2011 03:45:16 PM: > > > From: Andy Coburn <[email protected]> > . > . > . > > I believe you said that you did have multiple tasks adding to the queue > and > > one task removing them. This is how the problem can occur. > . > . > . > I don't know where I got the technique, but the best code for multiple > requesters and single server that is bullet proof and very efficient is: > > There are three queues - a requestor que, a process que and a reuseable > element que. > > assuming que elements have the first word of which is the ptr to the next > que element, the requestors push elements to the top of the requestor que > with a single CS. The elements are therefore in reverse order of > processing. > > when the server wants to process elements and has no work on its que, it > removes all elements from the requestor que and reorders them by reversing > the pointers, so that the last element on the requestor que becomes the > top element of the server que. the reordered que becomes its que. the > server then processes the elements on its que from top down using a single > CS to get each element. > > as elements are processed they are returned to the reuseable element que. > > this can be made to work for multiple servers but is messy as it requires > locking. but the concept is the same. > > I would put sample code but am late for dinner date. > > as was said in graduate school, the proof is left to the student. this is > I think easier than vector calculus or partial dif eq. > > -----------------------------------------
