Hey Rob,

Good to see you are at least trying to keep up :p

WaitMessage... Ah, I was wondering what that was for.... The question I
of course must supply is ... (dun dun dun) ... to attach said thread's
queue to said function?

Jason P.

In the mean time, I will certainly continue to provide some example in
addition to what yourself and Jez have worked on.

-----Original Message-----
From: Robert May [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006 5:52 PM
To: Emmanuel E
Cc: Plum, Jason; perl-win32-gui-users@lists.sourceforge.net
Subject: Re: [win32gui] Re: [perl-win32-gui-users] Multi-Threaded
Example

Hi all,

Apologies if I duplicate stuff that's already been said later in this 
thread, but I've only go a few minutes to try and catch up.

I'll post a link to the code that Jez and I were working on at the end 
of last year once I've got through the messages here.

Emmanuel E wrote:
> But would there be a way to avoid those select calls to spend some
time 
> sleeping? I mean if there were a way to do a select on a thread queue
it 
> would be great.

Win32::GUI::WaitMessage();

waits until there is one or more messages in the calling threads message

queue.

> On the other hand why not call Win32::GUI::Dialog() in the main thread

> and let the child threads update the screen?
> 
> I mean move this line to within the child threads: 
> $win->{pbT1}->SetPos($t1_in); and $win->{pbT2}->SetPos($t2_in); ?
> 
> If you move the create window code before you create any threads all 
> child threads will inherit the window.

They do, but you'll get nasty crashes every time a thread exits, as the 
DESTROY method on the objects get called in the exiting thread, and 
those DESTROY methods are not (even close) to being threadsafe.

> However I get the following message when the script exits:
> Scalars leaked: 1
> Scalars leaked: 1
> Wonder what thats related to?

Perl bugs - IIRC the docs say that this warning should not happen, and 
if it does there's a bug somewhere.

As an aside
   use diagnostics;
is a very useful pragma if you ever want more information about
warnings.

Regards,
Rob.

Reply via email to