in reply to Re: forking daemon under windows
in thread forking daemon under windows

It sounds like you want to poll your thread and not join it until it is joinable. Look into thread states, is_joinable() is probably what you seek.

-- Time flies when you don't know what you're doing

Replies are listed 'Best First'.
Re^3: forking daemon under windows
by Anonymous Monk on Nov 30, 2009 at 13:54 UTC
    Hi,

    Thanks for the reply. I am facing a problem with threading. I am redirecting to a different page and then closing STDOUT, STDERR and calling the function in thread,detaching it...so that it kinda runs in background.

    But once I run the CGI script...nothing happens ... in process list I dont see any perl.exe process. perl process is exiting.

    Is it a bug? Or I am doing something wrong. Thanks

      Any idea guys?

        Sure. "If it hurts, stop doing it."

        Windows has no concept of daemons, services are the closest thing to a Unix deamon. So maybe you want a service that you can control from your Perl script.

        A second problem with Windows is that it does not know the brilliant concept of "fork() and exec()", but instead has a ridiculously large and ever increasing number of functions and macros that wrap each other and finally start a new process with a huge load of mostly useless parameters. Short, fork() just does not work on Windows, even if newer perl versions have a pretty neat emulation. But it's just an emulation and things go wrong amazingly fast as soon as you expect it to do more than just creating a new instance of your Perl script.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)