|
Boost Users : |
Subject: Re: [Boost-users] [boost 1.42, gcc 4.4, ubuntu 10.10] Program hangs when using barrier.wait() even though all threads have reached wait.
From: Gareth (gareth.tpc_at_[hidden])
Date: 2011-06-23 17:41:47
D'oh, fell for that old one. I guess I did forget to put -Wall in my
makefile. Cheers.
2011/6/23 Ignacio Burgueño <iburgueno_at_[hidden]>:
>> On Thu, Jun 23, 2011 at 10:32 AM, Gareth <gareth.tpc_at_[hidden]> wrote:
>>
> ...
>
>>
>> >
>> > I've also checked the bugs list for any known bugs, fixed or
>> > otherwise, to do with threading and I haven't found anything. I'm not
>> > sure what I'm doing wrong.
>
> The problem is here:
> https://gist.github.com/1041351#L60
> You declare _barrier first and numCPU second, so in your constructor,
> _barrier will be initialized first, using the value of numCPU, which hasn't
> been initialized yet.
> Just change the order of the declarations. Declare _barrier below numNPU.
> By the way, compiling with -Wall catches all these errors.
> Regards,
> Ignacio Burgueño
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
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