[Info-vax] counting-lock ?

VAXman- at SendSpamHere.ORG VAXman- at SendSpamHere.ORG
Thu Oct 22 11:50:01 EDT 2009


In article <ab3b1520-380f-4992-9e28-1aecef898c71 at l34g2000vba.googlegroups.com>, H Vlems <hvlems at freenet.de> writes:
>On 22 okt, 14:33, Pierre <pierre.... at gmail.com> wrote:
>> hi,
>>
>> I have a DECnet object which can serve various known queries on a
>> database. these queries are resource consuming and I don't want more
>> than (say) n=5 of them of the same type to run at the same time. I
>> want the other one to be queued up for further processing.
>>
>> I first thought of using the lock manager. this would have work with
>> an exclusive lock for n=1 but n>1...
>>
>> I then thought of using counting-semaphores but the problem with
>> semaphores is that if the server process unexpectedly die before
>> signaling the its done with the resource, the slot it was using is
>> never freed.
>>
>> as unfortunately the DLM does not have "counting-locks" I had the idea
>> of creating a null lock for every possible query type and as many
>> exclusive sub-lock as needed, one for every possible instance of that
>> particular query. for each new request of that type, the newly created
>> object instance enqueue one exclusive lock on every sub-lock. as soon
>> as one is granted, it first dequeue the unneeded ones and starts its
>> job.
>>
>> do you see any flow in this algorithm ? do you see any other way of
>> doing it ?
>>
>> TIA,
>> Pierre.
>
>Pierre, my memory is weak but ISTR that a decnet object (at least with
>NCP) uses a DCL file to make it happen. Example, if you request a
>directory listing on a remote node, FAL is used and FAL.COM is the
>command procedure that gets executed. If your object works the same
>way you can define a logical name to control the number of instances,
>or use a file to store counters.
>Hans

If you can generate LMF PAKs, wouldn't a PAK with a unit count work?
Call $GRANT_LICENSE.  If there are available units, then the call can
proceed.  If not, try again.  Also, if a process dies, the LMF does
cleanup the license count if it issued one to the process that died.

-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

  http://www.quirkfactory.com/popart/asskey/eqn2.png
  
  "Well my son, life is like a beanstalk, isn't it?"



More information about the Info-vax mailing list