Re: [Boost-users] Maybe a problem with boost::object_pool?
Caleb
Thank you for taking the time to answer my email. I actually did use a
mutex to protect my queue.
I did another test very simple to reproduce the problem.
A program creates N threads that construct & destroy objects in an
object pool
With N = 9, it crashes on linux
Following is the source code of the program & the gdb trace.
Thank you for your help
#include <iostream>
#include
There are 2 threads. One thread creates Objects using boost::object_pool and enqueues them into a stl queue.
Are you using a mutex to protect the push/pop operations on the queue? If not, then this is your problem. -- Caleb Epstein caleb dot epstein at gmail dot com _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users -------------------------------------------------------- If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail. http://www.ml.com/email_terms/ --------------------------------------------------------
On 8/8/05, Labour, Matthieu (MLPRO SF)
A program creates N threads that construct & destroy objects in an object pool. With N = 9, it crashes on linux
That program works fine here with 1, 2, 4, 8, and 9 threads on a 2-way RedHat AS3.1 machine here. I've tried running it with "valgrind" and I don't get any errors. You might try running a memory test on your PC like memtest86. Perhaps you have bad RAM. -- Caleb Epstein caleb dot epstein at gmail dot com
participants (2)
-
Caleb Epstein
-
Labour, Matthieu (MLPRO SF)