Class

DexThreadPool

unstable since: 1.2

Description [src]

final class Dex.ThreadPool : GObject.TypeInstance
{
  /* No available fields */
}

DexThreadPool is a thread pool for managing native OS threads similar to GThreadPool.

The threads managed by DexThreadPool do not contain a DexScheduler which means that you cannot await futures or schedule DexBlock from a worker thread.

Threads are created up-front from dex_thread_pool_new().

DexThreadPool primarily exists for situations where you are using blocking external libraries and want to avoid calling dex_thread_spawn() without any sort of queuing or bounding on the permitted concurrency.

Available since: 1.2

Hierarchy

hierarchy this DexThreadPool ancestor_0 DexObject ancestor_0--this

Ancestors

Constructors

dex_thread_pool_new

Creates a fixed-size pool of reusable operating system threads.

unstable since: 1.2

Instance methods

dex_thread_pool_close

Begins shutting down the pool and prevents new submissions.

dex_thread_pool_get_n_threads

Gets the fixed number of threads owned by the pool.

unstable since: 1.2

dex_thread_pool_submit

Queues blocking work to run on one of the pool’s reusable threads.

unstable since: 1.2

Methods inherited from DexObject (2)
dex_ref

Acquires a reference on the given object, and increases its reference count by one.

dex_unref

Releases a reference on the given object, and decreases its reference count by one.