Code Monkey home page Code Monkey logo

pthread_pool's Introduction

pthread_pool

这个线程池是根据具体项目设计的,并没有严格的考虑有些地方的加锁,因为即使是个别的出错,不会影响任务的正常执行,以一定的误差来提高效率!! 线程池的动态变化也是采取了一个简单的策略:连续统计三次的平均空闲线程数量如果大于当前总线程数的一半,则需要销毁当前线程的1/5,以防止这种情况只是暂时的,而频繁的销毁和创建线程 关于管理线程的管理频率和动态更新策略,根据实际需要需要修改, 这二个线程池中没有设置任务队列,因为实际项目中的任务都是已经保存的,不会丢失,线程的主要任务就是处理任务,并删除任务,所以没有必要设置任务队列

pthread_pool's People

Contributors

raiet avatar

Watchers

James Cloos avatar  avatar

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.