in reply to Multithreading and DBI

I doubt it will take 10 minutes if you place the requests simultaneously. The server is the bottleneck, and the same amount of work still needs to be done by the server. You might want to look into optimizing your queries.

If you want to try it out, the simplest way would be to write your program such that it accepts the .sql file name as an argument, then you can do:

# unix myscript.pl file1.sql & myscript.pl file2.sql & myscript.pl file3.sql & myscript.pl file4.sql & myscript.pl file5.sql & myscript.pl file6.sql &
# Windows start perl myscript.pl file1.sql start perl myscript.pl file2.sql start perl myscript.pl file3.sql start perl myscript.pl file4.sql start perl myscript.pl file5.sql start perl myscript.pl file6.sql

Replies are listed 'Best First'.
Re^2: Multithreading and DBI
by knsridhar (Scribe) on Sep 21, 2005 at 15:24 UTC

    I want something like this. Hope this is clean.

                               |
    | MAIN PROCESS
    |
    V
    -------------------------------------------------
    | | | |
    | | | |
    ----- ----- ----- -----
    | 1 | | 2 | ....................... | 5 | | 6 |
    ----- ----- ----- -----
    Thread Thread Thread Thread
    One Two Five Six

      I know. I suggested something which is faster to code, less error prone due to the smaller code size, much more maintainable, and more reliable given the state of threads in Perl.
      Don't use threads unless you need to share data between threads. Fork and exec is simpler and faster for data independent processes.

      I'm not really a human, but I play one on earth. flash japh