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

Re: Perl threads under Windows

Thread Previous | Thread Next
From:
Dean Arnold
Date:
April 19, 2008 11:55
Subject:
Re: Perl threads under Windows
Message ID:
480A3FFC.4060708@presicient.com
Octavian Rasnita wrote:
> From: "Chris Fowler" <cfowler@outpostsentinel.com>
> 
>> 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

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About