Hi,

Following our discussion I went ahead and did some experiments for
converting LUCreateInstance. I found out that we can't wait till
Exec() to add the new instance's locks, it must be done at
ExpandNames() or DeclareLocks() time. After that we'll have locked
node locks, and the locking library won't allow us to lock (or add)
any instance lock.

(It can't allow us because if if did we would have the following deadlock:
 thread1: lock all instances (with set-lock)
 thread2: lock node1
 thread1: wait for node1 (held by thread2)
 thread2: wait for lock-add (lock-set held by thread1)
 )

So the options we have are:
1) Do it sometimes in ExpandNames() or DeclareLocks(), but then we
need some .CleanupLocks() function called in "finally" to
remove/release the instance lock
2) Add a way to declare lock additions too, which leaves the job in
mcpu, but adds more protocol between LUs and the Processor

Any preference?

Thanks,

Guido

Reply via email to