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
gc_probability: usize
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.
max_garbage_before_export: usize
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.
max_non_free_hazards: usize
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]
fn low_memory() -> Settings
Preset for low memory, high CPU usage.
fn low_cpu() -> Settings
Preset for high memory, low CPU usage.
fn disable_automatic_gc(&mut self)
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.
fn disable_automatic_export(&mut self)
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]
fn clone(&self) -> Settings
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for Settings
[src]
fn eq(&self, __arg_0: &Settings) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Settings) -> bool
This method tests for !=
.