That's it for Tutorial 7. As with Tutorial 6, we really didn't have to change much to introduce a new threading strategy. Most of the work was in creating the Thread_Pool object itself. Everything else was just minor housekeeping.
There is a fourth common thread strategy: thread-per-request. It's not one of my favorites, so I wasn't planning to go into it. If you want to contribute a tutorial on that topic though, I'll be glad to include it here.
For reference, here's the file list again:
The safest way to handle the situation is to use reference-counted pointers everywhere a Client_Handler pointer would be used. That's beyond the scope of the tutorial but I encourage you to give it a try. If you want to contribute that back as an enhanced Tutorial, I'll be glad to include it.
Another approach that should work quite well is to use the ACE_TP_Reactor instead of just ACE_Reactor. This takes a little more setup but results in a cleaner implementation. Again, I've not had time to develop a Tutorial on the TP_Reactor but would welcome any contributions.