Octavian Rasnita wrote:
From: "Chris Fowler" <[EMAIL PROTECTED]>
I ran into the same problem and just redesigned my program to now share
objects.
Oh, this sounds good. Can you please tell me how can this be done?
I want to use perl for creating apps with WxPerl and share objects among
threads.
I've seen that there are ways to just share scalar variables and send
messages to windows or use POE multitasking which is not very easy.
I would like to be able to share WxPerl objects and database handles
among threads.
Thank you very much!
Octavian
Wrt database handles, I presume you mean DBI handles. Alas,
DBI isn't fully threadsafe. There has been some work to provide
a thread pooling feature, but its (at best) experimental.
I'll offer DBIx::Threaded as a possible alternative, but its
a bit heavyweight.
wxPerl describes some details wrt threads:
http://search.cpan.org/~mbarbon/Wx-0.82/lib/Wx/Thread.pod
but I'm otherwise ignorant of it. (tho pleasantly surprised there's
any threads related documenation, given the sparseness
of the rest of wxPerl's docs...)
You can't really share wx objects, but instead use msg passing
between threads (same applies to Perl/Tk, and probably most other
GUI libs, due to the event control loop).
Good luck,
Dean Arnold