in reply to Multi-thread database script

I'm a bit late to this party. :-)

I'm not too sure about windows, but DBI / DBD::mysql on linux with threads works fine, for certain values of fine:

You can't share handles over multiple thread. You should probably not use a handle that's in scope from the parent thread either. Every thread should have its own database handle(s), so create new connections at the start of a thread if you need them.

You need to compile DBD::mysql with thread support. AFAIK most default builds are done without thread support even on systems that have a threaded perl.

On my (linux) system, that means running mysql_config  --libs_r and passing the output of that to Makefile.PL prior to compilation:

$ mysql_config --libs_r -L/usr/lib/mysql -lmysqlclient_r $ perl Makefile.PL --libs "-L/usr/lib/mysql -lmysqlclient_r"
Note that libmysqlclient_r.so is the threaded version of the libmysqlclient library on linux, libmysqlclient.so is the default, non-threaded version.

PS: starting a new thread in perl is slow. You might not want to do it for each event. Having a pool of threads is probably more efficient.