Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Do you cover Double Checked Locked Singletons?

 
Anand Hariharan
Rancher
Posts: 272
C++ Debian VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Congratulations on your book, Antony.

Took a look at the book's contents and the free introduction chapter. Seems like you would cover atomic<T> and similar new constructs introduced in the language.

Would like to know if you cover perils of using singletons (whether in general or in a multi-threaded environment), and include any coverage regarding the oft-lambasted 'double checked locking' pattern.

thank you for your attention,
- Anand
 
Anthony Aj Williams
author
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anand Hariharan wrote:Would like to know if you cover perils of using singletons (whether in general or in a multi-threaded environment), and include any coverage regarding the oft-lambasted 'double checked locking' pattern.


Double-checked locking is covered in chapter 3, where I recommend using std::call_once instead.
 
Anand Hariharan
Rancher
Posts: 272
C++ Debian VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Anthony.

sincerely,
- Anand
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic