Sylvain Joyeux
3/30/2007 7:19:00 AM
> Should exceptions automatically propagate from children up to the
> parent? And if so, why should the positioning of something as innocuous
> as sleep 1 matter?
Because you have a timeout on the join (a.join(1))
In the first case it sleeps one second, and waits for 'a' to finish. It
works if 'a' raises within two seconds. Note that it could also fail
since 'sleep' is not perfect and it is possible for the main thread to
reach the timeout on 'join' before 'a' raises.
In the second case, the main thread only waits 'a' for one second. It is
useless because of the sleep(2) in 'a'.
It should work as expected if you replace a.join(1) by a.join
--
Sylvain Joyeux