threadpool.ch

Declarations

Public Only
Publicnamespace std
namespace std
Publicnamespace concurrent
namespace concurrent
Publicfunction hardware_threads
func hardware_threads() : usize
Publicfunction sleep_ms
func sleep_ms(ms : ulong) : void
function spawn_native
func spawn_native(entry : func(*void) : *void, arg : *void) : usize
function join_native
func join_native(h : usize) : void
Publicstruct Thread
struct Thread
Publicfunction join
func join(self : &Thread) : void
Publicfunction spawn
func spawn(entry : func(*void) : *void, arg : *void) : Thread
Publicstruct Promise
struct Promise<T>
Publicfunction constructor
func constructor() : Promise
Publicfunction set
func set(self : &Promise, x : ) : void
function delete
func delete(self : *Promise) : void
Publicstruct Future
struct Future<T>
Publicfunction constructor
func constructor(pp : *Promise<>) : Future
Publicfunction get
func get(self : &Future) :
Publicfunction delete
func delete(self : &Future) : void
Publicstruct Task
struct Task
function worker_main
func worker_main(arg : *void) : *void
Publicstruct PoolData
struct PoolData
Publicfunction submit
func submit<T>(self : &PoolData, f : function<func() : >) : Future<>
Publicfunction submit_void
func submit_void(self : &PoolData, f : function<func() : void>) : void
Publicfunction delete
func delete(self : &PoolData) : void
Publicstruct ThreadPool
struct ThreadPool
just a wrapper around pool data that automatically
Publicfunction submit
func submit<T>(self : &ThreadPool, f : function<func() : >) : Future<>
Publicfunction submit_void
func submit_void(self : &ThreadPool, f : function<func() : void>) : void
Publicfunction delete
func delete(self : &ThreadPool) : void
Publicfunction create_pool
func create_pool(n : uint) : ThreadPool