develooper Front page | perl.ithreads | Postings from April 2008

Re: Perl threads under Windows

Thread Previous | Thread Next
Dean Arnold
April 19, 2008 11:55
Re: Perl threads under Windows
Message ID:
Octavian Rasnita wrote:
> From: "Chris Fowler" <>
>> 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:

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

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About