|
| | ImplicitProducer (ConcurrentQueue *parent_) |
| template<AllocationMode allocMode, typename U> |
| bool | enqueue (U &&element) |
| template<typename U> |
| bool | dequeue (U &element) |
| template<AllocationMode allocMode, typename It> |
| bool | enqueue_bulk (It itemFirst, size_t count) |
| template<typename It> |
| size_t | dequeue_bulk (It &itemFirst, size_t max) |
| | ProducerBase (ConcurrentQueue *parent_, bool isExplicit_) |
| template<typename U> |
| bool | dequeue (U &element) |
| template<typename It> |
| size_t | dequeue_bulk (It &itemFirst, size_t max) |
| ProducerBase * | next_prod () const |
| size_t | size_approx () const |
| index_t | getTail () const |
|
|
static const index_t | INVALID_BLOCK_BASE = 1 |
|
|
bool | isExplicit |
|
ConcurrentQueue * | parent |
|
ConcurrentQueueProducerTypelessBase * | next |
|
std::atomic< bool > | inactive |
|
ProducerToken * | token |
|
std::atomic< index_t > | tailIndex |
|
std::atomic< index_t > | headIndex |
|
std::atomic< index_t > | dequeueOptimisticCount |
|
std::atomic< index_t > | dequeueOvercommit |
|
Block * | tailBlock |
◆ ImplicitProducer()
template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
333174 :
333175 ProducerBase(
parent_,
false),
333177 blockIndex(nullptr)
333178 {
333179 new_block_index();
333180 }
Definition duckdb.cpp:331497
◆ ~ImplicitProducer()
template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
333183 {
333184
333185
333186
333187
333188
333189#ifdef MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED
333190
333193 }
333194#endif
333195
333196
333204 if (
block !=
nullptr) {
333205
333206 this->parent->add_block_to_free_list(
block);
333207 }
333208
333210 }
333211
333212 ((*block)[
index])->~
T();
333214 }
333215
333216
333217
333219 this->parent->add_block_to_free_list(this->tailBlock);
333220 }
333221
333222
333227 }
333228 do {
333234 }
333235 }
#define assert(x)
Definition duckdb.cpp:486071
◆ enqueue()
template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<AllocationMode allocMode, typename U>
333239 {
333243
333247 return false;
333248 }
333249#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX
333251#endif
333252
333255 return false;
333256 }
333257
333258
333261 rewind_block_index_tail();
333263 return false;
333264 }
333265#ifdef MCDBGQ_TRACKMEM
333267#endif
333269
333271
333274 }
333276 rewind_block_index_tail();
333278 this->parent->add_block_to_free_list(
newBlock);
333280 }
333281 }
333282
333283
333285
333287
333290 return true;
333291 }
333292 }
333293
333294
333296
333298 return true;
333299 }
Definition duckdb.cpp:333629
◆ dequeue()
template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename U>
333303 {
333304
333309
333314
333315
333316 auto entry = get_block_index_entry_for_index(
index);
333317
333318
333320 auto&
el = *((*block)[
index]);
333321
333323#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX
333324
333325
333327#endif
333333
333335 {
333336 (*block)[
index]->~T();
333340 }
333341 }
333343
333345 }
333346 else {
333349
333351 {
333352#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX
333354#endif
333355
333357 }
333358 this->parent->add_block_to_free_list(
block);
333359 }
333360 }
333361
333362 return true;
333363 }
333364 else {
333366 }
333367 }
333368
333369 return false;
333370 }
◆ enqueue_bulk()
template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<AllocationMode allocMode, typename It>
333374 {
333375
333376
333377
333378
333379
333380
333381
333382
333383
333388
333389
333393#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX
333395#endif
333396 do {
333399
333400
333408
333409
333411 rewind_block_index_tail();
333413 }
333419 rewind_block_index_tail();
333420 }
333423
333424 return false;
333425 }
333426
333427#ifdef MCDBGQ_TRACKMEM
333429#endif
333432
333433
333435
333436
333437
333439 assert(this->tailBlock !=
nullptr);
333440 this->tailBlock->next =
newBlock;
333441 }
333446 }
333447
333448
333455 }
333456 while (true) {
333460 }
333464 }
333465 }
333466 else {
333472 }
333473 }
333477
333482 }
333484 while (true) {
333488 }
333491 }
333493 break;
333494 }
333496 }
333497 }
333498
333504 rewind_block_index_tail();
333505 }
333509 }
333510 }
333511
333512 if (this->tailBlock ==
endBlock) {
333514 break;
333515 }
333516 this->tailBlock = this->tailBlock->next;
333517 }
333519 return true;
333520 }
◆ dequeue_bulk()
template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<typename It>
333524 {
333531
333533
333540 }
333541
333542
333543
333545
333546
333550 do {
333554
333559 auto&
el = *((*block)[
index]);
333563 }
333564 }
333565 else {
333568 auto&
el = *((*block)[
index]);
333573 }
333574 }
333576 do {
333580 (*block)[
index++]->~T();
333581 }
333582
333584#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX
333586#endif
333588 this->parent->add_block_to_free_list(
block);
333589 }
333591
333596
333598 }
333599 }
333601 {
333602#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX
333604#endif
333605
333606
333608 }
333609 this->parent->add_block_to_free_list(
block);
333610 }
333613
333615 }
333616 else {
333618 }
333619 }
333620
333621 return 0;
333622 }
◆ insert_block_index_entry()
template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
template<AllocationMode allocMode>
333645 {
333648 return false;
333649 }
333654
333657 return true;
333658 }
333659
333660
333662 return false;
333663 }
333664 else if (!new_block_index()) {
333665 return false;
333666 }
333673 return true;
333674 }
◆ rewind_block_index_tail()
template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
◆ get_block_index_entry_for_index()
template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
◆ get_block_index_index_for_index()
template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
333690 {
333691#ifdef MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX
333693#endif
333699
333700
333705 }
◆ new_block_index()
template<typename T, typename Traits = ConcurrentQueueDefaultTraits>
333708 {
333716 if (
raw ==
nullptr) {
333717 return false;
333718 }
333719
333723 if (
prev !=
nullptr) {
333727 do {
333732 }
333737 }
333741 header->capacity = nextBlockIndexCapacity;
333743
333745
333746 nextBlockIndexCapacity <<= 1;
333747
333748 return true;
333749 }
The documentation for this struct was generated from the following file: