Page 1 of 1

wxThread or c++11 thread?

Posted: Mon May 05, 2014 4:58 pm
by wxProgrammer
Hi! I have to write a software that must be very speed. I'll write this with thread for parallelism. In your opinion is better <thread> (C++11) or <wx/thread.h>? (The programm is for windows and I have to use wx for GUI principally)

Re: wxThread or c++11 thread?

Posted: Mon May 05, 2014 5:10 pm
by doublemax
From a performance point of view there is no difference. You can use whatever you prefer.

Re: wxThread or c++11 thread?

Posted: Mon May 05, 2014 6:39 pm
by wxProgrammer
Oh, perfect :) Thank you

Re: wxThread or c++11 thread?

Posted: Wed May 07, 2014 5:00 am
by eranif
I would stick to wxThread. Since it is a wrapper around other classes (pthread, Win Thread etc)
Using wxThread will make sure that your code will still compile when using an older compiler which does not support C++11 thread.

Also, I would expect that sometime in the future, wxThread will wrap std::thread (similar to wxString using std::{w}string)

Eran

Re: wxThread or c++11 thread?

Posted: Thu May 22, 2014 8:03 pm
by wxProgrammer
I use VC++ 11 (2012) and it have c++11 and work without problem :)