in reply to Threads and MySQL

You might look at POE there is an example in their cookbook that sounds close to what you are trying to do: DBI_Helper_Processes


"Look, Shiny Things!" is not a better business strategy than compatibility and reuse.

Replies are listed 'Best First'.
Re^2: Threads and MySQL
by chrispete (Initiate) on Jan 31, 2005 at 19:01 UTC
    Thanks guys, I've been looking over what I need the program to do and can't find any reason to continue using threads (I did previously need to share data with the parent and directly between the threads) but with the new version of the program I really don't need any centralized control anymore and the processes can easily share what little data they will be exchanging (only one R/W per hour) via a hash tied to a file (this is even better as it provides a permanent storage of the hash should the system croak for some reason - it'll be able to pick up near where it left off.)

    Thanks for the sanity check!

      If your tasks are using MySQL, why use a shared file (with all the inherent problems of locking etc.) to share data between them?

      FWIW: The problem with using DBI threads is a design flaw in DBI, not a problem with your code.


      Examine what is said, not who speaks.
      Silence betokens consent.
      Love the truth but pardon error.
        Two days ago I had a reason to not use the DB for storing that info - now I can't remember what it was, so... ;)

        Thanks for the help guys, the code is running fine with the fork/exec setup.

      Well, KISS is usually the best solution there is!


      "Look, Shiny Things!" is not a better business strategy than compatibility and reuse.