vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Class TaskPool

Implements a shared, multi-threaded task pool.

class TaskPool ;

Constructors

NameDescription
this (thread_count, thread_name_prefix) Creates a new task pool with the specified number of threads.

Properties

NameTypeDescription
threadCount[get] ulongReturns the number of worker threads.

Methods

NameDescription
join () Instructs all worker threads to terminate as soon as all tasks have been processed and waits for them to finish.
runTask (func, args) Runs a new asynchronous task in a worker thread.
runTaskDist (func, args) Runs a new asynchronous task in all worker threads concurrently.
runTaskDistH (on_handle, func, args) Runs a new asynchronous task in all worker threads and returns the handles.
runTaskH (func, args) Runs a new asynchronous task in a worker thread, returning the task handle.
terminate () Instructs all worker threads to terminate and waits until all have finished.
Authors

Sönke Ludwig

Copyright

© 2012-2020 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.