• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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).
 
Look! I laid an egg! Why does it smell like that? Tiny ad, does this smell weird to you?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic