in reply to Re^3: Debugging lock ownership
in thread Debugging lock ownership

I am using Perl 5.10.1 on Windows 7.

I do not use file locks, but the lock function instead:

{ lock(@ResultQueue); # ... access @ResultQueue ... }

Yes, I have access to a C compiler.

I thank you for your reply, but I am not looking for a solution to my locking problem here. I am looking for a way to debug the problem myself.

Replies are listed 'Best First'.
Re^5: Debugging lock ownership
by BrowserUk (Patriarch) on Aug 13, 2010 at 18:01 UTC
    Yes, I have access to a C compiler.

    You could rebuild having defined #define DEBUG_LOCKS at the top of shared.xs. The problem is then how to relate the addresses displayed:

    3e56088 waiting - owned by 3ef8c78 shared.xs:1032 3e56088 waiting - owned by 3ef8c78 shared.xs:1136 3e56088 waiting - owned by 3ef8c78 shared.xs:1208 3e56088 waiting - owned by 3ef8c78 shared.xs:1265 3e56088 waiting - owned by 3ef8c78 shared.xs:347 3e56088 waiting - owned by 3ef8c78 shared.xs:520 3e56088 waiting - owned by 3ef8c78 shared.xs:715 3e56088 waiting - owned by 4001018 shared.xs:1032 3e56088 waiting - owned by 4001018 shared.xs:1136 3e56088 waiting - owned by 4001018 shared.xs:1208 3e56088 waiting - owned by 4001018 shared.xs:1265 3e56088 waiting - owned by 4001018 shared.xs:347 3e56088 waiting - owned by 4001018 shared.xs:520 3e56088 waiting - owned by 4001018 shared.xs:715 3ef8c78 waiting - owned by 3e56088 shared.xs:1032 3ef8c78 waiting - owned by 3e56088 shared.xs:1136 3ef8c78 waiting - owned by 3e56088 shared.xs:1208 3ef8c78 waiting - owned by 3e56088 shared.xs:1265 3ef8c78 waiting - owned by 3e56088 shared.xs:347 3ef8c78 waiting - owned by 3e56088 shared.xs:520 3ef8c78 waiting - owned by 3e56088 shared.xs:715 3ef8c78 waiting - owned by 4001018 shared.xs:1032 3ef8c78 waiting - owned by 4001018 shared.xs:1136 3ef8c78 waiting - owned by 4001018 shared.xs:1208 3ef8c78 waiting - owned by 4001018 shared.xs:1265 3ef8c78 waiting - owned by 4001018 shared.xs:347 3ef8c78 waiting - owned by 4001018 shared.xs:520 3ef8c78 waiting - owned by 4001018 shared.xs:715 4001018 waiting - owned by 3e56088 shared.xs:1032 4001018 waiting - owned by 3e56088 shared.xs:1136 4001018 waiting - owned by 3e56088 shared.xs:1208 4001018 waiting - owned by 3e56088 shared.xs:1265 4001018 waiting - owned by 3e56088 shared.xs:347 4001018 waiting - owned by 3e56088 shared.xs:520 4001018 waiting - owned by 3e56088 shared.xs:715 4001018 waiting - owned by 3ef8c78 shared.xs:1032 4001018 waiting - owned by 3ef8c78 shared.xs:1136 4001018 waiting - owned by 3ef8c78 shared.xs:1208 4001018 waiting - owned by 3ef8c78 shared.xs:1265 4001018 waiting - owned by 3ef8c78 shared.xs:347 4001018 waiting - owned by 3ef8c78 shared.xs:520 4001018 waiting - owned by 3ef8c78 shared.xs:715

    Back to either thread ids or thread handles:

    tid 3 : handle: 4065f20 tid 2 : handle: 3fd9810 tid 1 : handle: 3f393b0

    The "trick" would be unravelling the defnition of aTHX, but I've never gotten to the bottom of that piece of tortuous magic.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.