in reply to Stability of threads in perl 5.8?

You really only need threads if you want to share data between threads in realtime. If not, forking is probably a better choice. Use a fork manager module to fork off a process for each file to be tailed.

If you need to constantly monitor the file tail results, you could use threads, but there are alot of caveats to watch for when using threads. Many times, threads need to be created before any other object code is called(due to non-threadsafe objects), so you may not be able to just use threads any way you want. Threads work well if properly setup for the situation, but you show use the SuperSearch box here and search for all the previous posts on threads. See Why use threads over processes, or why use processes over threads?


I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Replies are listed 'Best First'.
Re^2: Stability of threads in perl 5.8?
by BrowserUk (Patriarch) on Nov 05, 2007 at 13:31 UTC
    forking is probably a better choice

    But only if you are on a platform that supports a native fork. Otherwise you;re just using threads but without the control and a whole different set of caveats in addition to those of threads.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.