> -----Original Message-----
> From: [email protected] [mailto:activeperl-
> [email protected]] On Behalf Of Octavian Rasnita
> Sent: 07 January 2012 18:45
> To: [email protected]
> Subject: Using Parallel::ForkManager with ActivePerl
>
> Hi,
>
> In the POD documentation of Parallel::ForkManager I read that it can
> share the $dbh db handle among threads, but when I tried it with
> ActivePerl, it gave the following error:
>
> "DBD::mysql::db clone failed: handle 2 is owned by thread 2944fc not
> current thread 24475cc (handles can't be shared between threads and
> your driver may need a CLONE method added) at..."
>
> Does this happen because Perl can't use threads under Windows, but only
> a kind of fork() as pseudo threads? ...although, Parallel::ForkManager
> docs say that it can also work with fork.

I think you have that the wrong way round. Fork is implemented on win32 using 
threads, which would explain the thread references in the error message.

I could be wrong, but I can't imagine why using the same database connection in 
parallel processes/threads would be a good idea, even if it were possible. 
Could be very messy.

Also, see the 'perldoc DBI' section on threads and thread safety.

>
> Thanks.
>
> Octavian
>
> _______________________________________________
> ActivePerl mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Please consider the environment before printing this e-mail.

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient or have received this e-mail in error, please advise 
the sender immediately by reply e-mail and delete this message and any 
attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to