in reply to Taking advantage of dual processors [tag://parallel,cygwin,multi-core,fork,i/o]

It sounds as if you want to fork for the database. Maybe something like this:

wait; # wait for any previous child to finish my $pid = fork; die "Can't fork: $!" if ! defined $pid; if ( ! $pid ) { # child do_sqllite_stuff(); exit; # this is important }

Note that if you open a database handle in the parent, the child is going to clobber it. If you don't need to access the database in the parent, my advice is to open and close it in the child. Otherwise, have a look at DBI, fork, and clone..

  • Comment on Re: Taking advantage of dual processors [tag://parallel,cygwin,multi-core,fork,i/o]
  • Download Code