Class::DBI and fork



Hi,

I have been using class DBI for generating reports and till now most of
the work has been done off-hours so performance was not quite an issue.


I would now like to have some reports run interactively by a user, but
some of the has_many relationships take a significant amount of time.

So, for my inventory system, I was thinking about taking a list of
products from a user and forking parallell processes for each product
to get all relationships. Each fork would write to a separate file,
then I can reap all the files after completing all products.

The forking was done with Parallel::ForkManager, but when I run the
code, I get all sorts of Errors from Class::DBI, but I do not get those
errors if I remove forking. I suspect that the dbh file handle gets
trashed during the fork.

Can anybody comment or suggest an alternative?

Thanks,

.



Relevant Pages

  • Re: FreeBSD deadlock (with fork?)
    ... multiple threads. ... Do you create threads, which then fork(), or do you forkand then create ... I could limit the forking to a single thread ... One option I considered was forking a 'slave' program that then does all the ...
    (freebsd-current)
  • Re: FreeBSD deadlock (with fork?)
    ... The problem is the program often deadlocks, ... Do you create threads, which then fork(), or do you forkand then create ... I could limit the forking to a single thread ... One option I considered was forking a 'slave' program that then does all the ...
    (freebsd-current)
  • Re: [9fans] APE and listen(2B)
    ... not forking would make more sense. ... you could dispense with the ... forand the fork. ... the code suggests that the purpose of the separate proc is to ...
    (comp.os.plan9)
  • Re: Transport Agent
    ... Now I see how forking a message is working. ... Take a look at the following blog for information on how to fork for ... individual recipients. ... > seems to fork the message somehow. ...
    (microsoft.public.exchange.development)
  • Re: Preventing Accidentally Fork Bombing My Box
    ... I have a bad habit of accidentally fork ... > This is a pretty good sign that you are over-using the fork command. ... Many real-world forking examples involve calling ... forkin a loop. ...
    (perl.beginners)