<commit_before>// Manages a single participant in the epoch scheme. This is where all
// of the actual epoch management logic happens!

use std::{fmt, mem};
use std::cell::UnsafeCell;
use std::sync::atomic::{self, AtomicUsize, AtomicBool};

use mem::epoch::{Atomic, Guard, garbage, global};
use mem::epoch::participants::ParticipantNode;

/// The garbage collection threshold (in garbage items).
const GC_THRESHOLD: usize = 32;

/// Thread-local data for epoch participation.
pub struct Participant {
    /// The local epoch.
    ///
    /// This is incremented on new epochs.
    epoch: AtomicUsize,
    /// Number of pending uses of `epoch::pin()`.
    ///
    /// Keeping a count allows for reentrant use of epoch management.
    in_critical: AtomicUsize,
    /// The thread-local garbage tracking.
    garbage: UnsafeCell<garbage::Local>,
    /// Is the thread still active?
    ///
    /// This becomes `false` when the thread exits. This is ultimately used to free `Participant`
    /// records.
    pub active: AtomicBool,
    /// The next participant node.
    ///
    /// The participant list is coded intrusively; here's the pointer to the next node.
    pub next: Atomic<ParticipantNode>,
}
<commit_msg>Quad-double the GC threshold to improve performance.<commit_after>// Manages a single participant in the epoch scheme. This is where all
// of the actual epoch management logic happens!

use std::{fmt, mem};
use std::cell::UnsafeCell;
use std::sync::atomic::{self, AtomicUsize, AtomicBool};

use mem::epoch::{Atomic, Guard, garbage, global};
use mem::epoch::participants::ParticipantNode;

/// The garbage collection threshold (in garbage items).
const GC_THRESHOLD: usize = 128;

/// Thread-local data for epoch participation.
pub struct Participant {
    /// The local epoch.
    ///
    /// This is incremented on new epochs.
    epoch: AtomicUsize,
    /// Number of pending uses of `epoch::pin()`.
    ///
    /// Keeping a count allows for reentrant use of epoch management.
    in_critical: AtomicUsize,
    /// The thread-local garbage tracking.
    garbage: UnsafeCell<garbage::Local>,
    /// Is the thread still active?
    ///
    /// This becomes `false` when the thread exits. This is ultimately used to free `Participant`
    /// records.
    pub active: AtomicBool,
    /// The next participant node.
    ///
    /// The participant list is coded intrusively; here's the pointer to the next node.
    pub next: Atomic<ParticipantNode>,
}

{'fraction_non_alphanumeric': 0.11831442463533225, 'fraction_numerical': 0.002025931928687196, 'mean_word_length': 3.0675453047775947, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4526563', 'n_tokens_mistral': 705, 'n_tokens_neox': 685, 'n_words': 272}