Message Passing in Multi-Threaded Vision2 Application

3 Messages Forum Options Options
Embed this topic
Permalink
Brian Heilig
Message Passing in Multi-Threaded Vision2 Application
Reply Threaded MoreMore options
Print post
Permalink
Dear list,

The last time I did a multi-threaded Windows application I used the
SendMessage function to send my user-defined message from the worker
thread to the main application. I think this is what Petzold said to
do in his book.

How do I do that using Vision2? I don't have to necessarily send a
message to the main loop, but I do need to send a message from one
thread to another. EiffelStudio must do this all over the place.

Thanks for the help,
Brian


Emmanuel Stapf
RE: Message Passing in Multi-Threaded Vision2 Application
Reply Threaded MoreMore options
Print post
Permalink
> How do I do that using Vision2? I don't have to necessarily send a
> message to the main loop, but I do need to send a message from one
> thread to another. EiffelStudio must do this all over the place.

We do not do this kind of message passing in Vision2, instead you can simply post
actions to the GUI threads and they will be executed when the GUI thread is idle.
See {EV_APPLICATION}.do_once_on_idle for that.

Regards,
Manu

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------  
Peter Lubke
Re: Message Passing in Multi-Threaded Vision2 Application
Reply Threaded MoreMore options
Print post
Permalink
In reply to this post by Brian Heilig
Manu,
That sounds more like PostMessage. An asynchronous call.
SendMessage will executes in the same thread and returns.

Brian,
You need to think carefully about which kind of message you would want to send independent of library or language. If you want to make a synchronous call then you may be better off calling an APPLICATION or application derived feature directly - that is without sending a message. If it is an asynchronous call then Manus suggestion is the solution.

The message handling loops tend to just call a particular feature based on the message and its parameters - which you can do yourself.

Peter



----- Original Message ----
From: Emmanuel Stapf [ES] <manus@...>
To: eiffel_software@...
Sent: Wednesday, October 1, 2008 8:28:20 AM
Subject: RE: [eiffel_software] Message Passing in Multi-Threaded Vision2 Application


> How do I do that using Vision2? I don't have to necessarily send a
> message to the main loop, but I do need to send a message from one
> thread to another. EiffelStudio must do this all over the place.

We do not do this kind of message passing in Vision2, instead you can simply post
actions to the GUI threads and they will be executed when the GUI thread is idle.
See {EV_APPLICATION} .do_once_ on_idle for that.

Regards,
Manu

   


     

[Non-text portions of this message have been removed]