# C-ThreadPool **Repository Path**: mcjackteng/c-thread-pool ## Basic Information - **Project Name**: C-ThreadPool - **Description**: C语言ThreadPool 支持ThreadPool的异常监控 - **Primary Language**: C - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-02-18 - **Last Updated**: 2024-03-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #Introduce First, let's take a look at the consumption scene of coffee shops ![](一个咖啡店的说明.png) See the for the basic usage of thread pool Thread pool use epoll and eventfd to handle the events. The thread pool is driven by event, the events need to be added before scheduled, after the event scheduled, thread pool will select one available thread(idle status) to handle the event(call the event handler) Delay Time: this is cacluated between event ooccured and start-to-handle , if delay time is longer than you expect, it usually due to all threads are in working(blonked) status, in other words, there is no more availble thread to handle to the event, after one thread become availble , the s Handler Cost Time: this is calculated between event handler start and end. the event handler(written by user) is unknwown by threadpool , so some times if event handler was blocked or cost too much time, the TP_WARNING_ID_EVENT_HANDLER_COST_TOO_MUCH_TIME may help to get the reason. ![](ThreadPool时序.png)