- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
The snippet below will crash after a while with an access violation somewhere below tbb_debug.dll!concurrent_queue_base_v3::internal_push() when running 1 tbb thread for consume() and 10 for produce(). This is reproducible on my Vista 64 Box (snippet is compiled to 32 bits/debug). I am using Studio 2008 SP1. Any ideas?
struct QueuedCall
{
void unblock() { myQueue.push(1); }
void block() {
int dummy;
myQueue.pop(dummy);
}
tbb::concurrent_bounded_queue myQueue;
};
tbb::concurrent_queue myPendingCalls;
void consume() {
do {
QueuedCall *call;
if (myPendingCalls.try_pop(call))
call->unblock();
} while (true);
}
void produce() {
for (;;) {
QueuedCall *c = new QueuedCall();
myPendingCalls.push(c);
c->block();
delete c;
}
}
Link Copied
- « Previous
- Next »
88 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess you are looking at concurrent_bounded_queue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"I guess you are looking at concurrent_bounded_queue."
concurrent_queue.h:408: "using strict_ppl::concurrent_queue;"
concurrent_queue.h:43: "class concurrent_queue: public internal::concurrent_queue_base_v3 {"
concurrent_queue.h:166: "class concurrent_bounded_queue: public internal::concurrent_queue_base_v3"
So both non-bounded and bounded derive from internal::concurrent_queue_base_v3, which has the problematic code that I quoted earlier.
concurrent_queue.h:408: "using strict_ppl::concurrent_queue;"
concurrent_queue.h:43: "class concurrent_queue: public internal::concurrent_queue_base_v3
concurrent_queue.h:166: "class concurrent_bounded_queue: public internal::concurrent_queue_base_v3"
So both non-bounded and bounded derive from internal::concurrent_queue_base_v3, which has the problematic code that I quoted earlier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is 2 different concurrent_queue_base_v3. One of which has the following implementation:
void concurrent_queue_base_v3::internal_push( const void* src ) {
concurrent_queue_rep& r = *my_rep;
ticket k = r.tail_counter++;
r.choose(k).push( src, k, *this );
}
void concurrent_queue_base_v3::internal_push( const void* src ) {
concurrent_queue_rep
ticket k = r.tail_counter++;
r.choose(k).push( src, k, *this );
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"There is 2 different concurrent_queue_base_v3."
I have no words...
I have no words...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
They are defined in different namespaces: tbb::internal and tbb::strict_ppl::internal. :)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
- Next »