Forking and threading, multi-threading options in Perl
- 30 minute talk
Imagine you have the following problem. You have a list of IP addresses that you want to resolve to host names. You could iterate over them, one at a time, spending most of the time waiting for the network, but that's SLOW. A threaded application could allow you to have multiple processes running each waiting for the network as required, but you can have 10 or 100 network requests happening simultaneously rather than just one. This can cut the execution time of your program dramatically.
On the other hand, Perl has had an interesting history with threads. ithreads, pthreads, parallel forking... it can be difficult to determine what you should use and in what situation. Come on a whirlwind adventure as we discuss problems and challenges with successful strategies for solving each one.