<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 11-03-12 05:27 PM, Jer A wrote:
<blockquote cite="mid:SNT141-w110AAEFEB84932659373EB2CD0@phx.gbl"
type="cite">
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
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>
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>
</body>
</html>