Archived

This forum has been archived. Please start a new discussion on GitHub.

Ice with GUI

I am using Ice with Gtk. I have my GUI running in its own thread; it reads a mutex protected queue on every idle event. When other threads want to update the GUI, they dump a function object on the thread (and so on, active object pattern). This works pretty well, but I'm wondering if I can use an Ice::Connection somehow to hook Ice into the Gtk main loop. This would make networked GUI clients a lot easier to write...

Comments

  • No, this is not possible. Ice is inherently multi-threaded, and doesn't have any kind of "main loop".
  • Have you guys done any work with X Windows type GUI's?
  • You mean in combination with Ice? We used Qt from Trolltech in one project. This was under Windows, but it was supposedly portable to X11 as well. Most of us have some experience with X11 from former (non-Ice) projects.
  • Yes. How did you handle the threading?
  • We used the same pattern that you use, that is, have the dispatch threads that trigger GUI activity pass function objects to the main thread.

    For long-running client->server invocations, we used a separate thread to send requests (so that the GUI does not block), and had the GUI main thread pass a function object to this thread.