Subject: Re: [boost] [lockfree] crash in queue
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2013-01-25 01:41:20
>> I tried using lockfree::queue but I keep getting a crash. My
>> boost 1.53 beta1, g++ 4.5 / clang (from trunk, a few weeks old), both
>> in c+11, i7 6 cores / 12 threads.
>> My test program is pretty much your example, except that my data is
>> not an int but a boost::function.
>> As a note, the crash seems to happen only when I have many consumers.
>> Many producers and one consumer seem to be ok.
>> Am I doing something wrong?
> didn't test your code, but i'm pretty sure that boost::function is
> violating the requirements of the lockfree queue:
> * trivial copy constructor
> * trivial assignment
> * trivial destructor
> cheers, tim
oh sorry, I overlooked this.
Hmm that's pretty high requirements which leave me little choice other than
pointers I guess.
Yes, static asserts will help (oh and a bigger font for requirements ;-) ).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk