Monday, July 5, 2004, 5:31:35 AM, Patrick Caulfield wrote: > On Sat, Jul 03, 2004 at 10:33:56AM -0400, Jeff wrote: >> These are from reviewing http://people.redhat.com/~teigland/sca.pdf >> and the CVS copy of cluster/dlm/doc/libdlm.txt. >> ------------------------------------------------------------------ >> >> If a program requests a lock on the AST side can it wait for >> the lock to complete without returning from the original AST >> routine? Would it use the poll/select mechanism to do this? > In kernel space you shouldn't wait or do much work in the AST routine or > you can block the kernel's AST delivery thread. You can call dlm_lock() in an > AST routine though. > In userspace you can do pretty much what you like in the AST routine as (by > default) they run in a seperate thread - see libdlm for more details on this. Thanks for the answers. One more question about acquiring locks in the worker thread. Assuming I'm using pthreads if I want to call dlm_lock() in the worker thread (AST routine) and I need to wait for that dlm_lock() call to complete would I call dlm_get_fd() and loop calling dlm_dispatch() until I see that the lock completes? This involves dlm_dispatch() calling itself recursively which I assume is going to be ok. Can you call dlm_pthread_init() more than once to start multiple service threads? I have some routines which are called both by the mainline code and as an AST routine. I'm wondering if I need them to be aware of how they're called or whether they can always simply open the fd and use dlm_dispatch if they need to issue a 'blocking' dlm_lock() call.