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

RE: Invoking method in other thread context

Thread Previous
From:
Jan Dubois
Date:
January 8, 2008 13:40
Subject:
RE: Invoking method in other thread context
Message ID:
000c01c8523e$eb1a2bb0$c14e8310$@com
On Tue, 08 Jan 2008, Shmuel Fomberg wrote:
> I am currently playing with C#. It have a nice feature that one thread can
> call a function in other thread's context. (using the Invoke command, or the
> asynchronic BeginInvoke command)
> This is useful especially in a GUI program, where one thread is handling the
> GUI, and worker threads need to post status.
> 
> So how do we do it in Perl?
> Sending signal and relaying the command somehow?

All cross-thread communication with GUI threads should use the Windows message
queue.  Check your GUI library for an interface to the PostMessage() API to
send notifications from the worker thread to the GUI thread.

Cheers,
-Jan



Thread Previous


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