Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Hanging Threads

by WalkingZero (Sexton)
on Aug 18, 2007 at 20:38 UTC ( [id://633521]=note: print w/replies, xml ) Need Help??


in reply to Re: Hanging Threads
in thread Hanging Threads

I found the problem(s). My issue kept getting complicated by the fact that the way I'd fix one issue would cause another. Something in my loop structure before was originally causing the issue. So when I used the 'self' function to test for loop exit, it helped me fix my loop. The ->self function though appears to have been what was locking the threads and preventing them from rejoining. Once I removed those two lines, I was golden.

Replies are listed 'Best First'.
Re^3: Hanging Threads
by BrowserUk (Patriarch) on Aug 18, 2007 at 20:52 UTC
    The ->self function though appears to have been what was locking the threads and preventing them from rejoining.

    Intriguing. Could you try putting those two lines back, but changing

    my $threadid = threads->self:

    to

    my $threadid = threads->self->tid;

    And report back what happens.

    FYI. threads->self() returns the thread's object reference, threads->self->tid() returns the thread's numeric identifier.

    I'm not aware that it would make a difference, but there is the possibility of some kind of circular reference prevent cleanup?

    If the above change 'cures' the problem, it might be a bug worth reporting. That said, I couldn't make it happen in either of the builds I have available. Which version of threads are you using? Eg.

    perl -mthreads -le"print $threads::VERSION" 1.62

    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.
      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?
        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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2025-02-09 02:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (95 votes). Check out past polls.