Jeremy Muhlich wrote: > Has anyone here written a serious threaded server in perl? I can't seem > to find any threads + sockets examples anywhere.
Having written some "less than serious" daemons using threads on Win32, I tried using threads (via Net::Daemon) to implement an SMTP proxy server (which would be heavily used) on Win32. It worked, but it was inefficient. After reading up on how the current threading model is pretty much a "pseudo-fork" (as Dan Sugalski mentions in this thread), and knowing that Win32 forking in turn is simulated via OS threads, it became clear why it was as clunky as it was. Fortunately Net::Daemon is flexible and lets you use any of several multi processing models, so I switched to a pre-fork model (as Ben Tilly mentions in this thread), which seemed to work much better, though the daemon is still a memory hog (as might be expected, given the way forking is implemented). On a side note, I'd recommend Net::Server instead of Net::Daemon, as a multi processing module. It seems to have a cleaner API, and is less buggy, though isn't cross platform (doesn't work on Win32). -Tom -- Tom Metro Venture Logic, Newton, MA, USA "Enterprise solutions through open source." Professional Profile: https://www.linkedin.com/e/fps/3452158/ _______________________________________________ Boston-pm mailing list [email protected] http://mail.pm.org/mailman/listinfo/boston-pm

