Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: What's the best way to fetch data from multiple sources asynchronously?

by bsdz (Friar)
on Jan 01, 2007 at 19:20 UTC ( [id://592454]=note: print w/replies, xml ) Need Help??


in reply to What's the best way to fetch data from multiple sources asynchronously?

I've implemented something similar using threads before. You can set up a job queue and have worker threads collect these jobs (sql queries), execute them, then return the data to some shared data object such as an array or hash. This shared object might then be tied to your output screen (console or gui?). It will certainly work on Windows and Linux. How do you wish to port your program?
  • Comment on Re: What's the best way to fetch data from multiple sources asynchronously?

Replies are listed 'Best First'.
Re^2: What's the best way to fetch data from multiple sources asynchronously?
by perrin (Chancellor) on Jan 01, 2007 at 19:36 UTC
    Was the thing that you implemented using DBD::mysql? It's not very clear if that module is thread-safe.
      I did use DBD::mysql and it didn't cause any multi-threading problems. At least the module's documentation suggests it is thread safe. I may have kept a separate DB handle open in each thread though I am not entirely sure as it was several years ago.
        I'm sure you'd need a separate handle in each thread, but wasn't sure it would work at all. Thanks for the info.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://592454]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-24 17:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found