当前位置: 首页 > news >正文

【FileZilla】Client端的线程模型 (一)

CMainFrame构造---》CFileZillaEngineContex构造--》引起其成员变量lmpl构造--》引起fz::event_loop的构造,其中创建了两个线程(指针) task_和 timer_task_。

// In event_loop.cpp
event_loop::event_loop(thread_pool & pool): sync_(false)
{task_ = std::make_unique<async_task>(pool.spawn([this] { entry(); }));timer_task_ = std::make_unique<async_task>(pool.spawn([this] { timer_entry(); }));
}//In Mainfrm.h
class CMainFrame final : public wxNavigationEnabled<wxFrame>, public COptionChangeEventHandler
#if FZ_MANUALUPDATECHECK, protected CUpdateHandler
#endif
{
......CFileZillaEngineContext m_engineContext;
......
}//In engine_context.h
class FZC_PUBLIC_SYMBOL CFileZillaEngineContext final
{
......class Impl;std::unique_ptr<Impl> impl_;
......
}class CFileZillaEngineContext::Impl final
{
public:Impl(COptionsBase& options): options_(options), rate_limit_mgr_(loop_), tlsSystemTrustStore_(pool_){directory_cache_.SetTtl(fz::duration::from_seconds(options.get_int(OPTION_CACHE_TTL)));rate_limit_mgr_.add(&rate_limiter_);}~Impl(){}COptionsBase& options_;fz::thread_pool pool_;fz::event_loop loop_{pool_};// !!!!!!fz::rate_limit_manager rate_limit_mgr_;fz::rate_limiter rate_limiter_;option_change_handler option_change_handler_{options_, loop_, rate_limit_mgr_, rate_limiter_};CDirectoryCache directory_cache_;CPathCache path_cache_;OpLockManager opLockManager_;fz::tls_system_trust_store tlsSystemTrustStore_;activity_logger activity_logger_;
};

目前每次打开FileZilla就是四个线程,一个主线程及timer_entry()、timer_entry()和thread_entry()。

未完待续......

相关文章:

  • python-修改图片背景色
  • Missashe考研日记—Day37-Day43
  • 力扣310.最小高度树(拓扑排序,无向图),力扣.加油站力扣.矩阵置零​​​力扣.二叉树中的最大路径和
  • 如何在Firefox火狐浏览器里-安装梦精灵AI提示词管理工具
  • 计网实验(四)CS144 Lab4
  • 【技术原理】Linux 文件时间属性详解:Access、Modify、Change 的区别与联系
  • 2025年5月华为H12-821新增题库带解析
  • React学习———Redux 、 React Redux和react-persist
  • 分布式AI推理的成功之道
  • 20250515通过以太网让VLC拉取视熙科技的机芯的rtsp视频流的步骤
  • RK3588 桌面系统配置WiFi和蓝牙配置
  • 1、数据结构与算法(Python版-啃书)-绪论
  • 前端流行框架Vue3教程:16. 组件事件配合`v-model`使用
  • 【Java ee初阶】http(1)
  • 左手坐标系、右手坐标系、坐标轴方向
  • 2、数据操作DMLDQL
  • 中间件-MQ常见问题
  • 基于AH1101芯片的5V升18.6V LED恒流背光供电方案设计
  • 从代码学习深度学习 - 实战 Kaggle 比赛:图像分类 (CIFAR-10 PyTorch版)
  • electron进程通信
  • 跨越三十年友情,61岁余隆和60岁齐默尔曼在上海再度合作
  • 中国恒大披露清盘进展:要求债权人提交债权证明表
  • 时隔3年俄乌直接谈判今日有望重启:谁参加,谈什么
  • 李强会见巴西总统卢拉
  • 线下哪些商家支持无理由退货?查询方法公布
  • “降息潮”延续,多家民营银行下调存款利率