Quantcast

Will YARP use C++11 thread support?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Will YARP use C++11 thread support?

Truong Nghiem
Hello,

I am using YARP together with some C++11 code which uses C++11 thread and mutex support. As I reported earlier, this caused my program to crash if I mixed YARP and C++11 thread support, for example if I use C++11 mutex in a YARP thread (callback, reader) or vice versa. I used a temporary ugly solution to work around this problem by polling YARP ports in a dedicated C++11 thread. I wonder when YARP will use C++11 thread and mutex because as I browsed the YARP code, I saw an implementation using C++11 thread. If I compile my code in C++11 mode, will YARP automatically use C++11 thread? (it seemed not). Or do I have to set some macro to tell YARP to use C++11 thread?

Thanks for creating a very useful software.
Tim

 

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Will YARP use C++11 thread support?

Daniele E. Domenichelli
Hello Tim,


On 13/04/15 12:28, Truong Nghiem wrote:
> I wonder when YARP will
> use C++11 thread and mutex because as I browsed the YARP code, I saw an
> implementation using C++11 thread. If I compile my code in C++11 mode,
> will YARP automatically use C++11 thread? (it seemed not). Or do I have
> to set some macro to tell YARP to use C++11 thread?


If you enable the "YARP_EXPERIMENTAL_CXX11" CMake flag, YARP should
enable a few C++ features and use std::thread and std::mutex internally.

As the "EXPERIMENTAL" name suggests it is not very tested, therefore
there could be bugs, any feedback or patch is welcome! :)


Cheers,
 Daniele

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Loading...