Struct conc::settings::Settings [] [src]

pub struct Settings {
    pub gc_probability: usize,
    pub max_garbage_before_export: usize,
    pub max_non_free_hazards: usize,
}

Settings for the system.

Fields

The probability of triggering a GC when ticking.

Whenever the system "ticks" it generates a random number. If the number is below this setting, it will try to collect the garbage.

So, this probability is given such that 0 corresponds to never and !0 corresponds to nearly always.

The maximal amount of garbage before exportation to the global state.

When the local state's garbage queue exceeds this limit, it exports it to the global garbage queue.

The maximal amount of non-free hazards in the thread-local cache.

When it exceeds this limit, it will clean up the cached hazards. With "cleaning up" we mean setting the state of the hazards to "free" in order to allow garbage collection of the object it is currently protecting.

Methods

impl Settings
[src]

Preset for low memory, high CPU usage.

Preset for high memory, low CPU usage.

Disable GC for this settings instance.

This ensures that the current thread will not be blocked to collect garbage. The garbage can still be propagated and destroyed, it will just not happen in this thread.

Disable automatic exportation.

This ensures that no destructors gets exported to the global state before the thread exits. In particular, no destructor will be run unless exportation is explicitly done.

Trait Implementations

impl Copy for Settings
[src]

impl Clone for Settings
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Settings
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Settings
[src]

impl Debug for Settings
[src]

Formats the value using the given formatter.

impl Default for Settings
[src]

Returns the "default value" for a type. Read more