diff options
author | Tom Rondeau | 2012-12-19 13:38:24 -0500 |
---|---|---|
committer | Nicholas Corgan | 2013-02-06 12:35:06 -0800 |
commit | 01eab0c7e283db9c1cfff0a26296a49128062cca (patch) | |
tree | 018a9becab8641ebac71910a186d45324591e30c /gnuradio-core/src/lib/runtime/gr_block.cc | |
parent | 7bc415bd2875132ce321c5913950d23e7c9ad8b1 (diff) | |
download | gnuradio-01eab0c7e283db9c1cfff0a26296a49128062cca.tar.gz gnuradio-01eab0c7e283db9c1cfff0a26296a49128062cca.tar.bz2 gnuradio-01eab0c7e283db9c1cfff0a26296a49128062cca.zip |
core: working thread affinity concept into gr_blocks.
Example in gnuradio-core/src/examples/mp-sched/affinity_set.py
Documentation describing API in docs/doxygen/other/thread_affinity.dox
Diffstat (limited to 'gnuradio-core/src/lib/runtime/gr_block.cc')
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_block.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_block.cc b/gnuradio-core/src/lib/runtime/gr_block.cc index 5ba30955f..dca1fcf83 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.cc +++ b/gnuradio-core/src/lib/runtime/gr_block.cc @@ -251,6 +251,24 @@ gr_block::is_set_max_noutput_items() return d_max_noutput_items_set; } +void +gr_block::set_processor_affinity(const std::vector<unsigned int> &mask) +{ + d_affinity = mask; + if(d_detail) { + d_detail->set_processor_affinity(d_affinity); + } +} + +void +gr_block::unset_processor_affinity() +{ + d_affinity.clear(); + if(d_detail) { + d_detail->unset_processor_affinity(); + } +} + std::ostream& operator << (std::ostream& os, const gr_block *m) { |