mirror of
https://github.com/boostorg/fiber.git
synced 2026-02-20 14:42:21 +00:00
31 lines
1.0 KiB
Plaintext
31 lines
1.0 KiB
Plaintext
[/
|
|
Copyright Oliver Kowalke 2009.
|
|
Distributed under the Boost Software License, Version 1.0.
|
|
(See accompanying file LICENSE_1_0.txt or copy at
|
|
http://www.boost.org/LICENSE_1_0.txt
|
|
]
|
|
|
|
|
|
[section:processor_binding Processor binding]
|
|
|
|
For some applications it is convenient to bind the __worker_threads__ to processors/cores of the system. For this purpose __fn_bind_to_processors__ must
|
|
be given to constructor instead __pool_size__ so that a __worker_thread__ is created an bound the the core.
|
|
|
|
``
|
|
typedef boost::task::static_pool<
|
|
boost::task::unbounded_queue< boost::tp::fifo >
|
|
> pool_type;
|
|
|
|
// constructs thread-pool with worker-threads as
|
|
// CPUs/Cores are available on the system
|
|
pool_type pool( pool_type::bind_to_processors() );
|
|
``
|
|
|
|
The constructor takes additional arguments for the [link_work_stealing work-stealing algorithm] and [link_queue high-] and [link_queue low-watermark] too.
|
|
|
|
[note __boost_task__ does provide this feature only for Windows, Linux, AIX, HP-UX, Solaris and FreeBSD.]
|
|
|
|
|
|
[endsect]
|
|
|