MCPcopy Create free account

hub / github.com/DouglasDwyer/micropool / functions

Functions75 in github.com/DouglasDwyer/micropool

↓ 11 callersMethodset
Sets the value of the bit at `index`. Returns the previous value. All atomic orderings are possible.
src/thread_pool.rs:961
↓ 10 callersMethodget
Gets the inner value.
src/thread_pool.rs:540
↓ 6 callersMethodjoin
(self)
src/task.rs:53
↓ 5 callersMethodinvoke_sync_unchecked
Invokes `f` with the values `0..times`, potentially in parallel. # Safety The provided function should be [`Sync`] so that multiple threads can use
src/thread_pool.rs:534
↓ 5 callersMethodrun
(&self)
src/task.rs:191
↓ 4 callersFunctionabort_on_panic
Invokes the closure `f`. If `f` panics and unwinding reaches this stack frame, then aborts the process.
src/util.rs:122
↓ 4 callersMethodbuild
Creates a new [`ThreadPool`] initialized using this configuration.
src/thread_pool.rs:57
↓ 4 callersMethodcomplete
(&self)
src/task.rs:38
↓ 4 callersMethodlen
The number of bits in the array.
src/thread_pool.rs:942
↓ 4 callersMethodnotify
Notifies all listeners that this event has changed.
src/util.rs:31
↓ 4 callersMethodnum_threads
Sets the number of threads to be used in the thread pool.
src/thread_pool.rs:89
↓ 4 callersFunctionspawn_owned
Spawns an asynchronous task on the current thread pool. The returned handle can be used to obtain the result.
src/lib.rs:227
↓ 4 callersFunctionsplit_by_threads
Execute [`paralight`] iterators by batching elements. Every iterator will be broken up into `N` separate work units, where `N` is the number of pool t
src/lib.rs:166
↓ 3 callersMethodclone
(&self)
src/task.rs:158
↓ 3 callersMethodread_new_version
Checks to see whether the listener was signaled based upon the value of `atomic`. If so, updates the internal version counter (so that [`Self::wait`]
src/util.rs:104
↓ 3 callersMethodsplit_by
Execute [`paralight`] iterators by batching elements. Every iterator will be broken up into `chunks` separate work units, which may be processed in pa
src/thread_pool.rs:286
↓ 3 callersFunctionsplit_per_item
Execute [`paralight`] iterators with maximal parallelism. Every iterator item may be processed on a separate thread. Note: by maximizing parallelism,
src/lib.rs:31
↓ 3 callersMethodwait
Blocks the current thread. Returns when [`Event::notify`] has been called at least once since the previous call to [`Self::wait`] (or this listener's
src/util.rs:82
↓ 2 callersMethodcancel_task
Removes the provided task from the queue if it is found.
src/thread_pool.rs:518
↓ 2 callersMethodhelp_one_job
Attempts to find a job in `search_mask` and run it. Returns whether a job was found.
src/thread_pool.rs:613
↓ 2 callersMethodinstall
Changes the current context to this thread pool. Any attempts to use [`crate::join`] or parallel iterators will operate within this pool. Panics if ca
src/thread_pool.rs:172
↓ 2 callersFunctioninstall_local_advertise_mask
Sets the thread-local mask used for tracking available jobs. The mask can then be accessed by calling [`with_local_advertise_mask`].
src/thread_pool.rs:868
↓ 2 callersMethodjoin
Takes two closures and *potentially* runs them in parallel. It returns a pair of the results from those closures.
src/thread_pool.rs:229
↓ 2 callersMethodlisten
Begins listening for changes to `self`. The event listener will block until [`Self::notify`] is called by another thread.
src/util.rs:42
↓ 2 callersMethodpush_task
Schedules a task to be run on the pool.
src/thread_pool.rs:563
↓ 2 callersMethodspin_wait
Blocks the current thread, spinning in a loop for `cycles` before falling back to blocking with the operating system scheduler. Returns `true` only if
src/util.rs:64
↓ 2 callersMethodsplit_by_threads
Execute [`paralight`] iterators by batching elements. Every iterator will be broken up into [`Self::num_threads`] separate work units, which may be pr
src/thread_pool.rs:296
↓ 2 callersMethodsplit_per
Execute [`paralight`] iterators by batching elements. Each group of `chunk_size` elements may be processed by a single thread.
src/thread_pool.rs:276
↓ 2 callersMethodsplit_per_item
Execute [`paralight`] iterators with maximal parallelism. Every iterator item may be processed on a separate thread. Note: by maximizing parallelism,
src/thread_pool.rs:270
↓ 1 callersMethodhelp_global_jobs
Executes as many queued jobs as possible. Searches within the [`Self::global_advertise_mask`]. Returns `true` if at least one job ran.
src/thread_pool.rs:601
↓ 1 callersMethodinvoke
Invokes `f` with values `0..times`, potentially in parallel.
src/thread_pool.rs:554
↓ 1 callersMethodinvoke_parallel_job
Registers a job for `f` in the jobs list (if possible). Runs `f` with values `0..times` in parallel.
src/thread_pool.rs:661
↓ 1 callersMethodinvoke_parallel_job_at_slot
Writes the job for `f` into the slot at `index`. Then, executes the job and polls for other work until it finishes. # Safety The job slot `index` sh
src/thread_pool.rs:686
↓ 1 callersMethoditer_ones
Returns an iterator over all `true` values in the array. This is always an [`Ordering::Relaxed`] operation, since different parts of the array may be
src/thread_pool.rs:931
↓ 1 callersMethoditer_zeroes
Returns an iterator over all `true` values in the array. This is always an [`Ordering::Relaxed`] operation, since different parts of the array may be
src/thread_pool.rs:949
↓ 1 callersMethodpop_task
Removes a task from the queue, if one is available.
src/thread_pool.rs:594
↓ 1 callersMethodrelease_job_slot
Marks the given slot in [`Self::jobs`] as free. Other threads may reserve the slot and write information there. # Safety This function must only be
src/thread_pool.rs:767
↓ 1 callersMethodreserve_job_slot
Reserves a slot in the [`Self::jobs`] array where a new descriptor can be written. To do so, searches the [`Self::running_jobs`] bitset for a `false`
src/thread_pool.rs:777
↓ 1 callersMethodspawn_owned
Spawns an asynchronous task on the global thread pool. The returned handle can be used to obtain the result.
src/thread_pool.rs:188
↓ 1 callersMethodspawn_shared
Spawns a shared asynchronous task on the global thread pool. The returned handle can be used to obtain the result.
src/thread_pool.rs:197
↓ 1 callersFunctionwith_local_advertise_mask
Gets the thread-local mask that should be used when searching for available jobs. If [`install_local_advertise_mask`] was called, then returns a refer
src/thread_pool.rs:882
Functionadd
(c: &mut Criterion)
benches/criterion.rs:33
Methodbuild_global
Initializes the global thread pool. This initialization is optional**. If you do not call this function, the thread pool will be automatically initia
src/thread_pool.rs:67
Methodcancel
(self)
src/task.rs:30
Methodcreate_job_func
Wraps `f` in a callback that invokes it
src/thread_pool.rs:791
Methoddefault
()
src/thread_pool.rs:109
Methoddrop
(&mut self)
src/thread_pool.rs:304
Methoddrop
(&mut self)
src/util.rs:128
Methodelement_bit
Decomposes `index` into two parts: - The location of the [`AtomicU64`] within the backing array - The location of the bit within that number
src/thread_pool.rs:979
Methodfmt
(&self, f: &mut std::fmt::Formatter<'_>)
src/task.rs:75
Methodhelp
(&self)
src/task.rs:46
Methodidle_spin_cycles
Threads waiting for work will spin at least this many cycles before sleeping.
src/thread_pool.rs:81
Methoditer_pipeline
( self, input_len: usize, accum: impl Accumulator<usize, Accum> + Sync, reduce
src/thread_pool.rs:353
Methoditer_pipeline
( self, input_len: usize, accum: impl Accumulator<usize, Accum> + Sync,
src/lib.rs:56
Functionjoin
Takes two closures and *potentially* runs them in parallel. It returns a pair of the results from those closures.
src/lib.rs:210
Methodnew
Initializes a new pool with `builder`.
src/thread_pool.rs:144
Methodnew
Initializes a new event.
src/util.rs:24
Methodnext
(&mut self)
src/thread_pool.rs:1003
Functionnum_threads
The total number of worker threads in the current pool.
src/lib.rs:221
Methodspawn
( pool: &Arc<ThreadPoolState>, f: impl 'static + FnOnce() -> T + Send, )
src/task.rs:13
Methodspawn_handler
Sets a custom function for spawning threads.
src/thread_pool.rs:97
Functionspawn_shared
Spawns a shared asynchronous task on the current thread pool. The returned handle can be used to obtain the result.
src/lib.rs:233
Functionsplit_by
Execute [`paralight`] iterators by batching elements. Every iterator will be broken up into `chunks` separate work units, which may be processed in pa
src/lib.rs:120
Functionsplit_per
Execute [`paralight`] iterators by batching elements. Each group of `chunk_size` elements may be processed by a single thread.
src/lib.rs:75
Functionsum
(c: &mut Criterion)
benches/criterion.rs:18
Functiontest_add
()
src/lib.rs:248
Functiontest_execute_many
()
src/lib.rs:297
Functiontest_for_each
()
src/lib.rs:286
Functiontest_many_roots
()
src/lib.rs:336
Functiontest_sum
()
src/lib.rs:273
Functiontest_two_roots
()
src/lib.rs:314
Methodtry_join
(self)
src/task.rs:65
Methodupper_bounded_pipeline
( self, input_len: usize, init: impl Fn() -> Accum + Sync, process_item: impl
src/thread_pool.rs:320
Methodupper_bounded_pipeline
( self, input_len: usize, init: impl Fn() -> Accum + Sync, pro
src/lib.rs:35
Methodwith_current
Executes `f` within the context of the current thread pool. Initializes the global thread pool if no other pool is active.
src/thread_pool.rs:206