Boost logo

Boost Users :

Subject: Re: [Boost-users] question about boost::thread
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-09-12 18:36:20


AMDG

PingShan Li wrote:
> Here is my test program using boost::thread. I would expect this program to
> crash inside FunctionA because m_ClassA is no longer available.
>
> Can anybody help me to understand why it does not crash? thank you.
>

Incorrect programs are not guaranteed to crash.
The memory for m_ClassA is on the main thread's
stack and is almost certain to still be valid (at the
machine level) when FunctionA is called. In fact,
depending on your compiler it may not have been
overwritten at all.

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net