GithubHelp home page GithubHelp logo

wzq_utils's People

Contributors

chengxumiaodaren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

wzq_utils's Issues

线程池测试用例段错误问题

环境:wsl2 linux ubuntu20.4 on windows;
触发条件:在执行 test_thread过程中,随机输入回车键,提前销毁线程池对象;
猜测:
1、线程分离,通过回车,线程池管理对象结束了,其他线程依旧在运行中,在运行过程中依旧访问线程池对象的变量,而此时对象中的变量已经销毁,此时再访问可能出现未定义行为,严重可能引发崩溃。

目前只是猜测,未进行深入挖掘分析。

关于 single.h 的使用

我使用 single.h 中提供的模板类,但在编译的时候,提醒我还要实现undefined reference to `Singleton<Foo>::once_'
undefined reference to `Singleton<Foo>::value_',我知道这是是要做定义,但不知道该如何使用,对应的test.cc 中也没有使用。
请给一个合理的例子。

关于可变参数的线程池

~/thread/include/thread/thread_pool.h
129行
// 获取线程池中当前线程的总个数
int GetTotalThreadSize() { return this->worker_threads_.size(); }

按照worker_threads_的容器大小判断线程池数量是不对的,因为非核心线程结束后,不能够自动删除容器中的指针,如果长时间的使用,会浪费很多的内存。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.