Re: Glib::SignalIO Help



On 11/12/2010 04:30 PM, Chris Vine wrote:
On Fri, 12 Nov 2010 15:42:27 -0600
Michael Sierks<msierks sierkstech net>  wrote:
[snip]
well there is the main gui thread, which will handle updating the
gui. And there is the connection thread, which will handle
sending/receiving as well as maintaining any connection related data.
The plan is to have the connection thread emit signals to tell the
gui thread to update itself. I am hoping this is a good approach,
though I am still a little unsure. The plan was at a later time allow
multiple connections to be made, each on their own thread.
That should be fine with glibmm, if you use Glib::Dispatcher to
communicate with the main thread and use some kind of asynchronous
queue to pass the data. That didn't seem to be what your code snippet
was doing though. Does your worker thread have its own main loop?

Chris

PS It is a good idea to put the mailing list on the copy list




Sorry, The thread doesn't have its own main loop. Currently it just monitors the socket for data to read. Though I could be mistaken, wouldn't that count as having a main loop ? Using threads seems to be pretty complicated, I also thought they were necessary for this application. Should I be using threads like this with a program that is network intensive ?

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]