You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Steve Huston <sh...@riverace.com> on 2011/06/15 03:08:18 UTC

Review Request: Keep better track of threads avoiding deadlocks at process rundown

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/904/
-----------------------------------------------------------

Review request for qpid.


Summary
-------

Keeps track of Qpid runnable threads and other threads, ensuring that rundown doesn't deadlock.


This addresses bug QPID-3256.
    https://issues.apache.org/jira/browse/QPID-3256


Diffs
-----

  /trunk/qpid/cpp/src/qpid/sys/windows/Thread.cpp 1132733 

Diff: https://reviews.apache.org/r/904/diff


Testing
-------

Qpid regression test suite.


Thanks,

Steve


Re: Review Request: Keep better track of threads avoiding deadlocks at process rundown

Posted by Andrew Stitcher <as...@apache.org>.

> On 2011-06-16 12:56:46, Alan Conway wrote:
> > /trunk/qpid/cpp/src/qpid/sys/windows/Thread.cpp, line 85
> > <https://reviews.apache.org/r/904/diff/1/?file=21139#file21139line85>
> >
> >     Why the pointer? Just declare 
> >     
> >     std::map<unsigned, ThreadPrivate::shared_ptr> pQpidThreads;
> >     
> >     and let std::map take care of the memory management.

I'd also add that we don't use the hungarian variable notation either so the 'p' should be stripped (possibly from other places too)


- Andrew


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/904/#review849
-----------------------------------------------------------


On 2011-06-15 01:08:18, Steve Huston wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/904/
> -----------------------------------------------------------
> 
> (Updated 2011-06-15 01:08:18)
> 
> 
> Review request for qpid.
> 
> 
> Summary
> -------
> 
> Keeps track of Qpid runnable threads and other threads, ensuring that rundown doesn't deadlock.
> 
> 
> This addresses bug QPID-3256.
>     https://issues.apache.org/jira/browse/QPID-3256
> 
> 
> Diffs
> -----
> 
>   /trunk/qpid/cpp/src/qpid/sys/windows/Thread.cpp 1132733 
> 
> Diff: https://reviews.apache.org/r/904/diff
> 
> 
> Testing
> -------
> 
> Qpid regression test suite.
> 
> 
> Thanks,
> 
> Steve
> 
>


Re: Review Request: Keep better track of threads avoiding deadlocks at process rundown

Posted by Cliff Jansen <cl...@gmail.com>.

> On 2011-06-16 12:56:46, Alan Conway wrote:
> > /trunk/qpid/cpp/src/qpid/sys/windows/Thread.cpp, line 85
> > <https://reviews.apache.org/r/904/diff/1/?file=21139#file21139line85>
> >
> >     Why the pointer? Just declare 
> >     
> >     std::map<unsigned, ThreadPrivate::shared_ptr> pQpidThreads;
> >     
> >     and let std::map take care of the memory management.
> 
> Andrew Stitcher wrote:
>     I'd also add that we don't use the hungarian variable notation either so the 'p' should be stripped (possibly from other places too)

OK... this was previously invisible because I missed the <Publish> step :-(

The intended logic was that Thread::current() should have defined behavior, even if called from a static destructor.  Otherwise, you need a way to guarantee the std:map destructor is never called too soon.

The original JIRA's deadlock was in the context of a static destructor calling Thread::join().

On re-examiniation, the use of a non-POD lock mechanism is inconsistent with the stated goal.  Thank-you for the heads up.  I will work with Steve to address this and the naming problem.

I have a fixed version I will upload to a separate review... coming soon.


- Cliff


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/904/#review849
-----------------------------------------------------------


On 2011-06-15 01:08:18, Steve Huston wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/904/
> -----------------------------------------------------------
> 
> (Updated 2011-06-15 01:08:18)
> 
> 
> Review request for qpid.
> 
> 
> Summary
> -------
> 
> Keeps track of Qpid runnable threads and other threads, ensuring that rundown doesn't deadlock.
> 
> 
> This addresses bug QPID-3256.
>     https://issues.apache.org/jira/browse/QPID-3256
> 
> 
> Diffs
> -----
> 
>   /trunk/qpid/cpp/src/qpid/sys/windows/Thread.cpp 1132733 
> 
> Diff: https://reviews.apache.org/r/904/diff
> 
> 
> Testing
> -------
> 
> Qpid regression test suite.
> 
> 
> Thanks,
> 
> Steve
> 
>


Re: Review Request: Keep better track of threads avoiding deadlocks at process rundown

Posted by Alan Conway <ac...@redhat.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/904/#review849
-----------------------------------------------------------



/trunk/qpid/cpp/src/qpid/sys/windows/Thread.cpp
<https://reviews.apache.org/r/904/#comment1841>

    On linux this should be a PODMutex to ensure it is statically initialized before any possible use. Don't know if that's the case on Windows.



/trunk/qpid/cpp/src/qpid/sys/windows/Thread.cpp
<https://reviews.apache.org/r/904/#comment1842>

    Why the pointer? Just declare 
    
    std::map<unsigned, ThreadPrivate::shared_ptr> pQpidThreads;
    
    and let std::map take care of the memory management. 


- Alan


On 2011-06-15 01:08:18, Steve Huston wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/904/
> -----------------------------------------------------------
> 
> (Updated 2011-06-15 01:08:18)
> 
> 
> Review request for qpid.
> 
> 
> Summary
> -------
> 
> Keeps track of Qpid runnable threads and other threads, ensuring that rundown doesn't deadlock.
> 
> 
> This addresses bug QPID-3256.
>     https://issues.apache.org/jira/browse/QPID-3256
> 
> 
> Diffs
> -----
> 
>   /trunk/qpid/cpp/src/qpid/sys/windows/Thread.cpp 1132733 
> 
> Diff: https://reviews.apache.org/r/904/diff
> 
> 
> Testing
> -------
> 
> Qpid regression test suite.
> 
> 
> Thanks,
> 
> Steve
> 
>


Re: Review Request: Keep better track of threads avoiding deadlocks at process rundown

Posted by Steve Huston <sh...@riverace.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/904/#review948
-----------------------------------------------------------


This was continued in a separate review request, https://reviews.apache.org/r/987/

- Steve


On 2011-06-15 01:08:18, Steve Huston wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/904/
> -----------------------------------------------------------
> 
> (Updated 2011-06-15 01:08:18)
> 
> 
> Review request for qpid.
> 
> 
> Summary
> -------
> 
> Keeps track of Qpid runnable threads and other threads, ensuring that rundown doesn't deadlock.
> 
> 
> This addresses bug QPID-3256.
>     https://issues.apache.org/jira/browse/QPID-3256
> 
> 
> Diffs
> -----
> 
>   /trunk/qpid/cpp/src/qpid/sys/windows/Thread.cpp 1132733 
> 
> Diff: https://reviews.apache.org/r/904/diff
> 
> 
> Testing
> -------
> 
> Qpid regression test suite.
> 
> 
> Thanks,
> 
> Steve
> 
>