GithubHelp home page GithubHelp logo

multithread's Introduction

多线程

此仓库包含多个项目,均为多线程实现,目前实现了 C语言版本的线程池和改进的基于CPP的线程池,以及一个 封装的数据库连接池。

对于线程池的基本思路:使用一个管理线程负责 创建线程、销毁线程、可以动态控制线程数量,当任务过多时,会动态的创建新线程,当任务很少时,会销毁部分线程。工作线程负责处理 工作任务,任务队列使用 环形队列维护,新的任务会被加入到 任务队列中,已完成的任务会被移除任务队列。

对于数据库连接池的基本思路:较多的使用了C++11 的特性,是在 C++特性的线程池的基础上,实现的对MySQL API 的封装和改进,使用数据库连接池解决在高并发场景下,频繁的处理操作所造成的资源消耗。

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.