Re: Can a Multi-Threaded GTKMM Application Use std::thread Rather Than Glib::Thread?



Hi Chris,

From experience: Of course it is, if you   1. mutex critical sections or 2. lock-free ringbuffer   all events between the threads, there's
no reason you can't use 2 (or more) different "types" of threads in one app.

From a practical point of view, why would you? Glib::Thread should suffice for simulator / GUI separation...

Perhaps I'm not following your use-case, or maybe you want to play with the latest-and-greatest, I don't know.
I know there's some convenience things around std::thread that you might want for ease of use.. but I've always
coded those myself..

-Harry

On Sun, Oct 16, 2011 at 4:28 PM, Chris Gordon-Smith <c gordonsmith gmail com> wrote:
Hello All

I have recently introduced multi-threading into my artificial chemistry
simulator, so that the GUI can be active while the simulation is
running.

To do this, I've used Glib::Thread. Now that C++11 provides threading
with std::thread, I would prefer to use that. Is it possible to use
std::thread so that I have one thread for my GTKMM GUI, and one (or
more) for my simulation processing?

Chris Gordon-Smith
www.simsoup.info

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list



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