wxThread or c++11 thread? Topic is solved

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
wxProgrammer
Experienced Solver
Experienced Solver
Posts: 96
Joined: Thu Apr 17, 2014 10:10 am

wxThread or c++11 thread?

Post by wxProgrammer » Mon May 05, 2014 4:58 pm

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)
I'm Italian but we can speak C++ :)

User avatar
doublemax
Moderator
Moderator
Posts: 15173
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxThread or c++11 thread?

Post by doublemax » Mon May 05, 2014 5:10 pm

From a performance point of view there is no difference. You can use whatever you prefer.
Use the source, Luke!

wxProgrammer
Experienced Solver
Experienced Solver
Posts: 96
Joined: Thu Apr 17, 2014 10:10 am

Re: wxThread or c++11 thread?

Post by wxProgrammer » Mon May 05, 2014 6:39 pm

Oh, perfect :) Thank you
I'm Italian but we can speak C++ :)

eranif
Moderator
Moderator
Posts: 607
Joined: Tue Nov 29, 2005 7:10 pm
Location: Israel

Re: wxThread or c++11 thread?

Post by eranif » Wed May 07, 2014 5:00 am

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
IDE: CodeLite + wxCrafter
OS: All
https://wxcrafter.codelite.org
https://codelite.org

wxProgrammer
Experienced Solver
Experienced Solver
Posts: 96
Joined: Thu Apr 17, 2014 10:10 am

Re: wxThread or c++11 thread?

Post by wxProgrammer » Thu May 22, 2014 8:03 pm

I use VC++ 11 (2012) and it have c++11 and work without problem :)
I'm Italian but we can speak C++ :)

Post Reply