in reply to Sharing DBI between threads
No. It makes no sense. Your threads would send conflicting commands (assuming they can get themselves understood) since they'd be sharing a comm channel and a session. For example, imagine if the second thread tried to start a transaction after the first one has already started one.
Have each thread create its own connection.
The reason for this is to create a web scrapper which runs several threads each using different proxy/network interface and each thread sleeps some time between requests to avoid ban.
Wait, what's the point of using threads if they're just going to sleep? Using threads in a scrapper only makes sense if you're querying different servers, but you said they're all querying one server.
Also, what's the point of using different proxies?
Update: Added bottom half
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sharing DBI between threads
by Anonymous Monk on Jan 21, 2010 at 07:19 UTC | |
by ikegami (Patriarch) on Jan 21, 2010 at 08:10 UTC |