It seems that the last blog has been updated for nearly a year. I encountered an internship, job hunting, New Year's Eve, continue my internship, wait for graduation, and so on. I still caught up with the csdn password leakage incident and have never updated my blog. Later, several netizens reflected some problems in the thread pool. There was no time in the middle and it was a bit lazy. Today, only a few bugs have been fixed. The corrected source code has been updated on SourceForge. This thread pool supports dynamic addition of threads, and management threads regularly recycle redundant Idle threads.
V1.02:
Fixed the deadlock issue in the thread pool;
Corrected the segment error during task processing;
Added the setting options for thread pool resource recycle parameters;
Added the tp_run and tp_exit functions.
Unifies the source code style (sorry for the previous inconsistency of the source code style, but there are indeed many improvements)
PS: Recently, a high-performance and high-concurrency server processing framework model has been designed based on libev to easily cope with c10k problems. I have time to read and write a blog. To be honest, it takes a long time to write a blog. It takes a long time to write a blog, and I have to draw pictures... Therefore, please respect the author'sArticlePlease attach the source address to the post. Thank you.
Download source code:Https://sourceforge.net/projects/thd-pool-linux/