小编Daf*_*fan的帖子

在'perf stat'结果中,什么是停滞 - 循环 - 前端和停滞 - 循环 - 后端?

有人知道在perf stat结果中stalled -cycles-frontendstalled-cycles-backend是什么意思吗?我在互联网上搜索但没有找到答案.谢谢

$ sudo perf stat ls                     

Performance counter stats for 'ls':

      0.602144 task-clock                #    0.762 CPUs utilized          
             0 context-switches          #    0.000 K/sec                  
             0 CPU-migrations            #    0.000 K/sec                  
           236 page-faults               #    0.392 M/sec                  
        768956 cycles                    #    1.277 GHz                    
        962999 stalled-cycles-frontend   #  125.23% frontend cycles idle   
        634360 stalled-cycles-backend    #   82.50% backend  cycles idle
        890060 instructions              #    1.16  insns per cycle        
                                         #    1.08  stalled cycles per insn
        179378 branches                  #  297.899 M/sec                  
          9362 branch-misses             #    5.22% of all …
Run Code Online (Sandbox Code Playgroud)

linux optimization performance cpu-architecture computer-architecture

68
推荐指数
4
解决办法
2万
查看次数

关闭 boost asio ssl 套接字时需要调用 ssl::stream::shutdown 吗?

我的代码如下:

declaration: boost::asio::ssl::stream<boost::asio::ip::tcp::socket> m_remote_socket;

m_remote_socket.shutdown(ec);
if (ec)
{      
    cdbug<<"id: "<<m_id<<", error when ssl shutdown: "    <<boost::system::system_category().message(ec.value()).c_str(); 
}
m_remote_socket.lowest_layer().shutdown(boost::asio::ip::tcp::socket::shutdown_both, ec);
if (ec)
{
    cdbug<<"id: "<<m_id<<", error when tcp shutdown: "<<boost::system::system_category().message(ec.value()).c_str(); 
}
Run Code Online (Sandbox Code Playgroud)

每次调用m_remote_socket.shutdown,都会报错。这种具有非常大错误值的未知错误。

但是m_remote_socket.lowest_layer().shutdown()不调用直接调用也可以m_remote_socket.shutdown

有人能告诉我如何关闭 ssl 流套接字吗?

c++ sockets ssl boost boost-asio

6
推荐指数
1
解决办法
5760
查看次数