• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Porting pre-C++11 code

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey there,

I have a bunch of multithreaded C++ code (using pthreads, unix style mutexes, OS specific memory barriers and such). Does your book cover strategies for porting existing C++ code to the new C++11 standard? Or is it simply a matter of replacing constructs one at a time? Any general advice? Thanks, and welcome to the ranch!

bjorn
 
author
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bjorn Roche wrote:I have a bunch of multithreaded C++ code (using pthreads, unix style mutexes, OS specific memory barriers and such). Does your book cover strategies for porting existing C++ code to the new C++11 standard? Or is it simply a matter of replacing constructs one at a time? Any general advice?



There is an appendix which shows the correspondence between various thread libraries (including POSIX threads) and the C++11 thread library, and the relevant chapter for details, but no specific advice about porting. I would go for a piecemeal approach, replacing each construct in turn: code that uses the C++11 thread library should work quite nicely alongside code that uses the raw platform API, and you should be able to use POSIX mutexes on threads spawned with std::thread, and std::mutex on threads spawned with pthread_create (for example).
 
That new kid is a freak. Show him this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic