in reply to perl -Dusethreads compilation

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.
"I'd rather go naked than blow up my ass"

Replies are listed 'Best First'.
Re^2: perl -Dusethreads compilation
by mr_p (Scribe) on Apr 05, 2010 at 14:47 UTC
    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.
        # create n numbers of threads #create ftp connection/login while (1) { wait msg Q(); 1. dequeue element 2. download file from ftp server. 3. delete file. } # Master Thread #create ftp connection/login while (1) { if 'files exist on ftp server' { enqueue files to download } }

        To sum it, master threads gets list to download files and workers just downloads the file.

        I am worried about multiple threads colliding, race condtions, in NET::FTP module.