C# program to create a thread pool
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Program:
Output:
Explanation:
In the above program, we created a class MyThreadPool that contains two methods ThreadFun1 and ThreadFun2 to represent tasks. The MyThreadPool class also contains a Main() method to start program execution. Here we created Object TP of MyThreadPool class.
The above code, The WaitCallBack() method is used to point the method to execute thread from the pool of thread.