This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Anthony.

sincerely,
- Anand
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic