• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

STEllAR-GROUP / hpx / #857

28 Dec 2022 11:12PM UTC coverage: 86.543% (-0.06%) from 86.602%
#857

push

StellarBot
Merge #6118

6118: Modernize modules from level 17, 18, 19, and 20 r=hkaiser a=hkaiser

working towards https://github.com/STEllAR-GROUP/hpx/issues/5497

Modules:
- core/threading_base
- full/command_line_handling
- core/io_service
- core/schedulers
- core/synchronization
- core/futures
- core/thread_pools
- core/lcos_local
- core/pack_traversal
- core/resource_partitioner
- core/threading
- full/naming_base


Co-authored-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>

849 of 849 new or added lines in 98 files covered. (100.0%)

174389 of 201505 relevant lines covered (86.54%)

1916353.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/libs/core/io_service/src/io_service_thread_pool.cpp
1
//  Copyright (c) 2017-2022 Hartmut Kaiser
2
//
3
//  SPDX-License-Identifier: BSL-1.0
4
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
5
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6

7
#include <hpx/config.hpp>
8
#include <hpx/affinity/affinity_data.hpp>
9
#include <hpx/assert.hpp>
10
#include <hpx/concurrency/barrier.hpp>
11
#include <hpx/io_service/io_service_pool.hpp>
12
#include <hpx/io_service/io_service_thread_pool.hpp>
13
#include <hpx/threading_base/callback_notifier.hpp>
14
#include <hpx/threading_base/scheduler_mode.hpp>
15

16
#include <cstddef>
17
#include <exception>
18

19
namespace hpx::threads::detail {
20

21
    io_service_thread_pool::io_service_thread_pool(
×
22
        hpx::threads::thread_pool_init_parameters const& init)
23
      : thread_pool_base(init)
×
24
      , threads_(init.notifier_, init.name_.c_str())
×
25
    {
×
26
    }
×
27

28
    hpx::state io_service_thread_pool::get_state() const
×
29
    {
30
        return hpx::state::stopped;
×
31
    }
32

33
    hpx::state io_service_thread_pool::get_state(
×
34
        std::size_t /* num_thread */) const
35
    {
36
        return hpx::state::stopped;
×
37
    }
38

39
    bool io_service_thread_pool::has_reached_state(hpx::state /* s */) const
×
40
    {
41
        return true;
×
42
    }
43

44
    ///////////////////////////////////////////////////////////////////////////
45
    void io_service_thread_pool::create_thread(thread_init_data& /* data */,
×
46
        thread_id_ref_type& /* id */, error_code& /* ec */)
47
    {
48
    }
×
49

50
    thread_id_ref_type io_service_thread_pool::create_work(
×
51
        thread_init_data& /* data */, error_code& /* ec */)
52
    {
53
        return invalid_thread_id;
×
54
    }
55

56
    threads::thread_state io_service_thread_pool::set_state(
×
57
        thread_id_type const& /* id */, thread_schedule_state /* new_state */,
58
        thread_restart_state /* new_state_ex */, thread_priority /* priority */,
59
        error_code& /* ec */)
60
    {
61
        return threads::thread_state(threads::thread_schedule_state::terminated,
×
62
            threads::thread_restart_state::unknown);
63
    }
64

65
    threads::thread_id_ref_type io_service_thread_pool::set_state(
×
66
        hpx::chrono::steady_time_point const& /* abs_time */,
67
        thread_id_type const& id, thread_schedule_state /* newstate */,
68
        thread_restart_state /* newstate_ex */, thread_priority /* priority */,
69
        error_code& /* ec */)
70
    {
71
        return id;
×
72
    }
73

74
    void io_service_thread_pool::report_error(
×
75
        std::size_t /* num */, std::exception_ptr const& /* e */)
76
    {
77
    }
×
78

79
    ///////////////////////////////////////////////////////////////////////////
80
    bool io_service_thread_pool::run(
×
81
        std::unique_lock<std::mutex>& l, std::size_t num_threads)
82
    {
83
        HPX_ASSERT(l.owns_lock());
×
84
        HPX_UNUSED(l);
×
85
        util::barrier startup(1);
×
86
        return threads_.run(num_threads, false, &startup);
×
87
    }
×
88

89
    void io_service_thread_pool::stop(
×
90
        std::unique_lock<std::mutex>& /* l */, bool /* blocking = true */)
91
    {
92
    }
×
93

94
    void io_service_thread_pool::resume_direct(error_code& /* ec */)
×
95
    {
96
        HPX_ASSERT_MSG(
×
97
            false, "Resuming io_service_thread_pool is not supported");
98
    }
×
99

100
    void io_service_thread_pool::suspend_direct(error_code& /* ec */)
×
101
    {
102
        HPX_ASSERT_MSG(
×
103
            false, "Suspending io_service_thread_pool is not supported");
104
    }
×
105

106
    void io_service_thread_pool::suspend_processing_unit_direct(
×
107
        std::size_t /* virt_core */, error_code& /* ec */)
108
    {
109
        HPX_ASSERT_MSG(false,
×
110
            "Suspending threads on io_service_thread_pool is not "
111
            "supported");
112
    }
×
113

114
    void io_service_thread_pool::resume_processing_unit_direct(
×
115
        std::size_t /* virt_core */, error_code& /* ec */)
116
    {
117
        HPX_ASSERT_MSG(false,
×
118
            "Suspending threads on io_service_thread_pool is not "
119
            "supported");
120
    }
×
121

122
    std::thread& io_service_thread_pool::get_os_thread_handle(
×
123
        std::size_t global_thread_num)
124
    {
125
        return threads_.get_os_thread_handle(
×
126
            global_thread_num - this->thread_offset_);
×
127
    }
128

129
    std::size_t io_service_thread_pool::get_os_thread_count() const
×
130
    {
131
        return threads_.size();
×
132
    }
133
}    // namespace hpx::threads::detail
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc