Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Can C++0X concurrency be implemented only as a library?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anthony,
I understand I can get a C++0X thread library (like yours :-) to start using the new C++ multithreading features with my current compiler.
However, I suppose there are the other C++0X concurrency features for which I need a new version of the compiler. If so, what are those?

Best regards,
Örjan Petersson
 
author
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Orjan Petersson wrote:Anthony,
I understand I can get a C++0X thread library (like yours :-) to start using the new C++ multithreading features with my current compiler.
However, I suppose there are the other C++0X concurrency features for which I need a new version of the compiler. If so, what are those?



The key concurrency feature which cannot be implemented as a library is the thread_local keyword. My library provides a macro (JSS_THREAD_LOCAL()) which emulates this facility in some contexts, but it cannot provide a general solution, and requires you to use a macro rather than a keyword.

The use of constexpr to guarantee static initialization for objects of class type (such as std::mutex) cannot be emulated either. In some cases the compiler will naturally do the required static initialization as part of normal optimization, but in others it will generate dynamic initialization code to call the relevant constructor.
 
This is my favorite tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic