MCPcopy Create free account
hub / github.com/NthTensor/Forte / scope

Function scope

src/thread_pool.rs:2431–2439  ·  view source on GitHub ↗

Creates a new scope for spawning non-static work. When executed on a thread that is currently registered as a worker (i.e. the closure inside [`Membership::activate`], [`ThreadPool::with_worker`], or similar) this is able to look up that registration and find the worker and thread-pool implicitly. If not called within a thread pool, this uses the [`DEFAULT_POOL`]. If you have a reference to a [

(f: F)

Source from the content-addressed store, hash-verified

2429 ///
2430 /// # Panics
2431 ///
2432 /// Panics in the operation are passed to the pool's panic handler, as
2433 /// described in [`Worker::spawn`].
2434 #[inline(always)]
2435 pub fn spawn_broadcast<F>(&self, f: F)
2436 where
2437 F: for<'w> Fn(Broadcast<'w>) + Send + Sync + 'static,
2438 {
2439 // Prevent workers from leaving the pool, and read the membership bitset
2440 // once it's frozen.
2441 let members = self.thread_pool.freeze_membership();
2442 let participants = members.count_ones() as usize;

Callers 5

rayonFunction · 0.85
rayonFunction · 0.85
scope_concurrencyFunction · 0.85
updateMethod · 0.85

Calls 1

scopeMethod · 0.80

Tested by 2

scope_concurrencyFunction · 0.68