Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: Hanging Threads

by WalkingZero (Sexton)
on Aug 18, 2007 at 21:38 UTC ( #633527=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Hanging Threads
in thread Hanging Threads

That did correct the issue, so something with that reference is causing the issue. Is it possible that when the ->self function is called it's creating a lock on that memory space? I tried running the command you asked for the threads version, it doesn't produce any output. Thoughts on that one?


Comment on Re^4: Hanging Threads
Replies are listed 'Best First'.
Re^5: Hanging Threads
by BrowserUk (Pope) on Aug 18, 2007 at 21:52 UTC
    I tried running the command you asked for the threads version, it doesn't produce any output. Thoughts on that one?

    Um. It probably means you are using a core delivered version of threads? Which version of Perl are you using?


    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.
      v5.8.8 built for i486-linux-gnu-thread-multi

        If you have the interest in discovering more, given that you already have a solution, then you could try installing the latest CPAN version (1.63) and see if that also cures the problem with using threads->self().

        I have 1.63 installed and it's not an easy task to back that out, but if that cures the problem for you it's probably safe to conclude it is a old problem that has already been fixed.

        Strange that I never encountered it in the couple of years that I've been using 5.8.6/5.8.8, but then I always use threads->self->tid for identification purposes and have never had reason to obtain or reference a thread handle from within it's own thread procedure.

        As I mentioned, there is a certain logic to it. If the thread procedure contains a reference to itself, then you have a circular reference, and that is a well-known problem that prevents destructors being called.

        I wonder how they cured it? The usual method is to weaken the reference (artificially drop the reference count), but looking inside 1.63 they appear to mortalise before returning it--which I thought meant that the ref count was increased? But then, there is a bunch of the internal shenanigans that is tantamount to black magic as far as my understanding goes.


        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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://633527]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2015-07-08 00:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls