I've done this with the dbd::sqlite module before, but rather than using threads, I used POE and POE::Component::EasyDBI.  If I recall correctly, you needed to be careful about sqlite locking the database file for write (I seem to recall implementing some retry logic to deal with that) and thus preventing other processes from writing at the same time.  But that shouldn't be an issue for you if you're reading. <br>
<br>mock<br><br><div class="gmail_quote">On Sat, Mar 12, 2011 at 6:46 PM, Brendan <span dir="ltr"><<a href="mailto:brendan@ming.org">brendan@ming.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


  
    
  
  <div text="#000000" bgcolor="#ffffff"><div class="im">
    On 11-03-12 05:27 PM, Jer A wrote:
    <blockquote type="cite">
      
      I want to get data from multiple databases using sqlite.<br>
      instead of processing command at a time, or a chain sequence,<br>
      I would like to execute them in multiple threads, and have them
      all join.<br>
      this is going to be used in a cgi script, and possibly a cron job.
      <br>
      are there any issues using sqlite and perl in this manner?<br>
    </blockquote>
    <br></div>
    it's probably safe, so long as you declare the dbi object inside
    each thread (if you declare it prior to starting up the worker
    threads, you could end up with problems). dbd::sqlite is probably
    thread safe, but if you are worried DBIx::Threaded purports to make
    any DBD module thread safe (though i'm sure you'll pay some price in
    memory usage).<br>
    <br>
    Threaded::Queue or Threaded::Queue::Duplex can help you get the data
    back to your master thread (instead of using a perl shared variable
    - the two queue modules use threadshared objects, but they are
    without any of the problems you might accidently cause yourself
    using :shared)<br>
  </div>

<br>_______________________________________________<br>
Victoria-pm mailing list<br>
<a href="mailto:Victoria-pm@pm.org">Victoria-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/victoria-pm" target="_blank">http://mail.pm.org/mailman/listinfo/victoria-pm</a><br></blockquote></div><br>