Classes | Namespaces | Functions

Thread Pool API
[Mulithreading Libraries]

Caller can provide a Datahash containing configuration. More...

Collaboration diagram for Thread Pool API:


class  threadpool::Pool
 base threadpool object More...


namespace  threadpool


virtual bool threadpool::Pool::addRequest (thread_work_fn fn, void *context)=0
static smart_ptr< Pool > threadpool::Pool::create (const Datahash *params)

Detailed Description

Caller can provide a Datahash containing configuration.

This initializes a pool of worker threads.

Then the caller can add requests to the pool. The next available worker will pick up and execute the request.

NOTE: This isn't actually a thread pool yet! This library creates threads per request. But the API should be stable, and a real thread pool can be implemented underneath.

Function Documentation

virtual bool threadpool::Pool::addRequest ( thread_work_fn  fn,
void *  context 
) [pure virtual, inherited]
smart_ptr< Pool > threadpool::Pool::create ( const Datahash params  )  [static, inherited]

Definition at line 223 of file threadpool.cpp.