Reading List

The Selfish Gene
The Psychopath Test: A Journey Through the Madness Industry
Bad Science
The Feynman Lectures on Physics
The Theory of Everything: The Origin and Fate of the Universe


ifknot's favorite books »

Sunday 23 February 2014

Part (1/2): Active Objects for Asynchronous Logging.

Asynchronous physical humour 

In his 2010 Dr Dobbs article[1] Herb Sutter espouses
"Prefer Using Active Objects Instead of Naked Threads"
The laudability of this is derived from Sutter's 2009 and 2007 observations[2],[3] that
"Use Threads Correctly = Isolation + Asynchronous Messages" 
(N.B. It is fascinating to read Sutter's 2009[2] & 2007[3] similarities to Sir Tony Hoare[6] 1978 seminal work on Communicating Sequential Processes(CSP)[7] and J. Paul Morrison[8] 1970s original ideas on Flow-Based Programming(FBP)[9] but more of this later...)

TL;DR Think you can walk-the-walk? You don't know Jack about thread programming if you haven't read [3], [2] & [1]



Therefore, it's time to get to grips with tactics of the asynchronous serializor policy for the logging services[4] to realise the defined strategy:

Strategy:
  • An easy to use, fast and versatile logger that works well with FBP programming and libfbp in particular.
Tactics:
  • thread-safe
  • asynchronous
  • fungible
The fungibility is already realised via the template policy approach, as previously described[4] leaving only the the thread safe Active Object base to be built as the asynchronous serializor.

But, early in Sutter's article[1] he casually writes
"Note that I'll assume message_queue is a thread-safe internally synchronized message queue that doesn't need external synchronization by its caller. If you don't have such a queue type handy, you can use an ordinary queue type and protect it with a mutex."
Erm, that'd be a no then. Which leads me nicely on to my next blog entry...

References:

No comments:

Post a Comment