mr_p has asked for the wisdom of the Perl Monks concerning the following question:

Hi again everyone,

I am using threads in my program, and I wanted to know if it is a must for me to compile perl with -Dusethreads option?

What does -Dusethreads option do? Also, Major part of my code deals with using Net::FTP in threads, does anyone know if I should use semaphores with it?

Thanks for you help.

Replies are listed 'Best First'.
Re: perl -Dusethreads compilation
by moritz (Cardinal) on Apr 05, 2010 at 14:27 UTC
    -Dusethreads enables threading in Perl. It is described in the INSTALL file in the perl source tree, which also describes the rest of the compilation process.
    Perl 6 - links to (nearly) everything that is Perl 6.
      What does it mean when it says...
      The default is to compile without thread support.
      Does it mean that it installs a thread module or there are some internal code base protection that are copiled and used to prevent race conditions in threads?
        without thread support

        means just what it says. There will be no module threads, and there will be no support for more than one thread at a time.

        A reply falls below the community's threshold of quality. You may see it by logging in.
Re: perl -Dusethreads compilation
by BrowserUk (Patriarch) on Apr 05, 2010 at 14:33 UTC
    Also, Major part of my code deals with using Net::FTP in threads, does anyone know if I should use semaphores with it?

    What would you use the semaphores for? (Ie. Why do you think you might need to use semaphores?)


    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.
      Blocking certain critical blocks of code.

        Which critical blocks of code?

        (This would go a lot quicker of you gave us some clue as to what you are trying to do! Ie. Post your code, or at the very least, some pseudo-code of what you're intending to do. As is, your question is impossible to answer.)


        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.