| |

VerySource

 Forgot password?
 Register
Search
View: 830|Reply: 3

Linux thread pool usage code !!!

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-3-17 01:00:01
| Show all posts |Read mode
I recently looked at the technology of the Linux thread pool
Many articles say that "implementing a universal thread pool framework consists of five important parts: CThreadManage, CThreadPool, CThread, CJob, and CWorkerThread. In addition, the framework also includes the classes CThreadMutex and CCondition for thread synchronization."

Are the definitions of these classes custom or refer to that system header file? Didn't figure it out ?!

Which brother Taiwan has this code, let me show it, thank you !!!
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 Germany

Post time: 2020-6-19 10:00:01
| Show all posts
Is it from that library?
Simple pool can write one by itself, it is not difficult
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-7-19 09:45:01
| Show all posts
Write the thread yourself, it's relatively simple
General-purpose ones are generally difficult to handle
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-7-19 11:00:01
| Show all posts
Self-defined

The thread pool controls the number of threads
It is to control the maximum number of threads at a time,

When the number of threads reaches the maximum, the creation of threads will be blocked until a thread finishes its work and exits.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list