opencog-dev team mailing list archive
-
opencog-dev team
-
Mailing list archive
-
Message #00256
Re: Threaded agents and attention allocation
On Thu, Jul 10, 2008 at 12:06 PM, Joel Pitt <joel.pitt@xxxxxxxxx> wrote:
> On Thu, Jul 10, 2008 at 12:01 PM, Joel Pitt <joel.pitt@xxxxxxxxx> wrote:
>> Another question with the locking. What happens when:
>>
>> 1. Agent one has an lvector containing atoms [A, B]
>> 1. Agent two has an lvector containing atoms [C, D]
>>
>> Agent one requests a lock on atom C, so it waits for Agent two to
>> release it. But then Agent two requests a lock on atom A. Would this
>> be a race condition? Or is this situation avoided by having the
>> AtomTable lock?
>
> Sorry, that should have been "Would this be a deadlock?" - getting my
> terminology mixed up!
If deadlock possibility isn't already guarded against somehow, then
(after doing some reading and reminding myself of stuff from my
undergrad days) we could perhaps do a partial ordering using STI or
LTI and use the Resource hierarchy solution:
http://en.wikipedia.org/wiki/Dining_philosophers_problem#Resource_hierarchy_solution
Alternatively Wait/Die, Wound/Wait methods are probably more efficient
in the hopefully rare case that deadlock condition occurs:
http://en.wikipedia.org/wiki/Deadlock#Avoidance
Obviously this isn't my forte, but thought these suggestions would at
least get the discussion going.
J
References