work with a queue

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
User avatar
baert
I live to help wx-kind
I live to help wx-kind
Posts: 169
Joined: Wed Sep 15, 2004 1:52 pm
Location: France - Compiegne-Paris-Lille

work with a queue

Post by baert » Thu Feb 09, 2006 4:28 pm

HI,

I'm working on a way to send messages between two modules of my application.
I was thinking on doing two thread:
on one side, one is writing the message
on another one, it is reading, to keep the things independant.

WIch object could I used to be written/red by the two thread in a secure way ?
does wx provide a sort of "queue" ?
Bart

chris
I live to help wx-kind
I live to help wx-kind
Posts: 150
Joined: Fri Oct 08, 2004 2:05 pm
Location: Europe

Post by chris » Thu Feb 09, 2006 6:24 pm

Hi baert,

isn't that what wxEvent is meant for?
There's an example in samples\event in your wx folder, you may want to have a look at that.

HTH, Chris
this->signature=NULL;

User avatar
baert
I live to help wx-kind
I live to help wx-kind
Posts: 169
Joined: Wed Sep 15, 2004 1:52 pm
Location: France - Compiegne-Paris-Lille

Post by baert » Thu Feb 09, 2006 6:56 pm

May be I could do that using wxEvent, but if I want to work with my iwn thread, what kind of "queue" do you suggest ?

a wxList could deal with that ?
Bart

chris
I live to help wx-kind
I live to help wx-kind
Posts: 150
Joined: Fri Oct 08, 2004 2:05 pm
Location: Europe

Post by chris » Thu Feb 09, 2006 7:05 pm

I have to admit that I didn't try it, but couldn't you just derive your receiving thread from wxEvtHandler, then push it via wxWindow::PushEventHandler() and simply use the already existing message queue (via PostEvent())?
this->signature=NULL;

Post Reply