Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- locking items in a collection
- Tim Keith
October 9, 2004, 4:52 am
rate this thread
to lock 1 to 10 items in a single request. Multiple processes
may request "tokens" from the collection. At any time 1 to 10
items of the collection can be assigned to unique process ids
during which time a lock is held on the token.
Each item must have a specific name, lock requests are made
for a count of items. When items are unlocked, the unlock
request can use either a handle returned by the original
lock request, or in a special case - unlocked by a request
using its ordinal value(1 - 10).
Each of the ten items will be tied to a process id (and possibly
other arbitrary data). When the process terminates the token
can be unlocked so that other processes may request a lock for
No two requests should be assigned the same token when multiple
requests for tokens occur simulaneously.
Is there a CPAN module that would provides this functionality?
Re: locking items in a collection
Are "items" and "tokens" the same thing?
Are you sure it isn't 0 to 10 of them? Is the state of an item being
assigned to a process ids identical to the state of a process holding
a lock on a token, or are those two different actions?
What is the point of them having specific names if they are not
asked for by that specific name? What happens if the count can only
be partially satisfied?
What does this mean? Obviously, a process that holds a lock on a token
"knows" that it does so. And a process can contain any aribtrary data,
and therefore can associate it with a token. Is that not sufficient? If
not, what else is required? Does the lock server need to report to other
processes on who own certain locks?
"Can be" or "must be"? Is autodetection of dead connections allowed, or
I was thinking of DBD::MySQL to work with MySQL lock manager (which
let's you coordinate locking of arbitrary string tokens), but it appears
that any connection can only hold one lock at a time. That means each
client would need upto 10 separate connections, which would not be very
Are all the processes going to run ont the same machine? Are they all
going to be started by forking? Or by threads? Or independently?
-------------------- http://NewsReader.Com / --------------------
Usenet Newsgroup Service $9.95/Month 30GB