
27 May
2008
27 May
'08
9:01 p.m.
I just discovered that while none of my standard containers are "move-aware" in the way needed by boost::thread, I can use boost::array to store threads by simply move-assigning new threads into the elements it contains: boost::array<boost::thread, 100> thread_q; for (int i = 0; i < 100; ++i) thread_q[i] = boost::thread( some_function ); it ain't perfect, but given that the number of cores on any real machine is limited these days, you can do a lot with a fixed-size array of thread. Pretty cool; it sure beats using shared_ptr. -- Dave Abrahams BoostPro Computing http://www.boostpro.com