The Same Script, A Different Actor


A huge, lumbering dinosaur wakes up, looks in the mirror and sez: “WTF! Look how ugly and immobile I am!“. After pondering its predicament for a few moments, Mr. Dino has an epiphany: “All I gotta do is go on a diet and get a makeover!“. Diet Makeover It’s the same old, same old, script:

  1. A large company’s performance deteriorates over time because of increasing bureaucracy, apathy, and inertia.
  2. Wall St. goes nutz, pressuring the company to take action.
  3. A new, know-it-all, executive with a successful track record is hired on to improve performance.
  4. The nouveau executive mandates sweeping, across-the-board, changes in the way people work without consulting the people who do the work.
  5. The exec makes the rounds in the press, espousing how he’s gonna make the company great again.
  6. After all the hoopla is gone, the massive change effort flounders and all is forgotten – it’s back to the status quo.

The latest incarnation of this well worn tale seems to describe what’s happening in the IT department at longtime IT stalwart, IBM: IBM CIO Designs New IT Workflow for Tech Giant Under Pressure. We’ve heard this all before (Nokia, Research In Motion, Sun, etc):

The mission is to have innovation and the speed of small companies .. and see if we can do that at scale – IBM Corp. CIO Jeff Smith

I’ll give you one guess at to what Mr. Smith’s turnaround strategy is…

Give up? It’s, of course, “Large Scale, Distributed, Agile Development“.

I can see all the LeSS (Large Scale Scrum) and SAFe (Scaled Agile Framework) consultants salivating over all the moolah they can suck out of IBM. Gotta give ’em credit for anticipating the new market for “scaling Agile” and setting up shop to reap the rewards from struggling, deep-pocketed, behemoths like IBM. It’s ironic that IBM wants to go Agile, yet a part of their business is to provide Agile consulting expertise to other companies. In fact, one of their former Agile consultant employees, Scott Ambler, invented his own Agile processes: Agile Unified Process (AUP) and Disciplined Agile Delivery (DAD).

Obviously, not all massive turnaround efforts fail. In fact, IBM did an about face once before under the leadership of, unbelievably, a former Nabisco cookie executive named Lou Gerstner. I like IBM. I hope they deviate from the script and return to greatness once again.

Categories: business, management Tags: , ,

A Semi-Organized Mess

May 25, 2015 3 comments

I don’t know when this post will be published, but I started writing it at 6:13 AM on Saturday, May 16, 2015. I had woken up at 4:00 AM (which is usual for me) and started drafting a blog post that’s currently titled “The Stuff That’s Hard To Change“. Then, whilst in the midst of crafting that post, a partially formed idea popped into my head for another post. So I:

  • pushed the first idea aside,
  • executed a mental context switch, and
  • started writing the second post (which is currently titled “Programs, Projects, Products“).

Whilst writing the second post, yet another idea for a third post (the one you’re currently reading) came to mind. So, yet again, I spontaneously performed a mental context switch and started writing this post. Sensing that something was amiss, I stepped back and found myself… thrashing all over the freakin’ place!

In case you’re wondering what my browser and visio tabs looked like during my maniacal, mutli-tasking, fiasco, here’s a peek into the semi-organized mess that was churning in my mind at the time:

All Over

Thankfully, I don’t enter a frenzied, ADHD, writing state that often. Because of my training as a software engineer and the meticulous thinking style required to write code, I’m usually a very focused, single-tasking, person – sometimes too focused, and oblivious to what’s happening outside of my head.

Oh, I almost forgot, but the act of writing the previous paragraph reminded me. I squeezed in a fourth task during my 4:00 AM to 6:00 AM stint at my computer. I prototyped a C++ function that I knew I needed to use at work soon:

isInitialized

I actually wrote that code first, prior to entering my thrashful writing state. And, in extreme contrast to my blogging episode, I wrote the code in a series of focused, iterative, write/test/fix, feedback loops. There was no high speed context-switching involved. It’s strange how the mind works.

The mind is  like a box of chocolates. Ya never know what you’re gonna get.

Embrace

 

Categories: miscellaneous Tags: , ,

Acting In C++

May 21, 2015 3 comments

Because they’re a perfect fit for mega-core processors and they’re safer and more enjoyable to program than raw, multi-threaded, systems, I’ve been a fan of Actor-based concurrent systems ever since I experimented with Erlang and Akka (via its Java API). Thus, as a C++ programmer, I was excited to discover the “C++ Actor Framework” (CAF). Like the Akka toolkit/runtime, the CAF is based on the design of the longest living, proven, production-ready, pragmatic, actor-based, language that I know of – the venerable Erlang programming language.

Curious to check out the CAF, I downloaded, compiled, and installed the framework source code with nary a problem (on CentOS 7.0, GCC 4.8.2). I then built and ran the sample “Hello World” program presented in the user manual:

CAF HW

As you can see, the CAF depends on the use one of my favorite C++11 features – lambda functions – to implement actor behavior.

The logic in main() uses the CAF spawn() function to create two concurrently running, message-exchanging (messages of type std::string), actors named “mirror” and “hello_world“. During the spawning of the “hello_world” actor, the main() logic passes it a handle (via const actor&) to the previously created “mirror” actor so that “hello_world” can asynchronously communicate with “mirror” via message-passing. Then, much like the parent thread in a multi-threaded program “join()“s the threads it creates to wait for the threads to complete their work, the main() thread of control uses the CAF await_all_actors_done() function to do the same for the two actors it spawns.

When I ran the program as a local C++ application in the Eclipse IDE, here is the output that appeared in the console window:

CAF mirror

The figure below visually illustrates the exchange of messages between the program’s actors during runtime. Upon being created, the “hello_world” actor sends a text message (via sync_send()) containing “Hello World” as its payload to the previously spawned “mirror” actor. The “hello_world” actor then immediately chains the then() function to the call to synchronously await for the response message it expects back from the “mirror” actor. Note that a lambda function that will receive and print the response message string to the console (via the framework’s thread-safe aout object) is passed as an argument into the then() function.

CAF HW actors

Looking at the code for the “mirror” actor, we can deduce that when the framework spawns an instance of it, the framework gives the actor a handle to itself and the actor returns the behavior (again, in the form of a lambda function) that it wants the framework to invoke each time a message is sent to the actor. The “mirror” actor behavior: prints the received message to the console, tells the framework that it wants to terminate itself (via the call to quit()), and returns a mirrored translation of the input message to the framework for passage back to the sending actor (in this case, the “hello_world” actor).

Note that the application contains no explicit code for threads, tasks, mutexes, locks, atomics, condition variables, promises, futures, or thread-safe containers to futz with. The CAF framework hides all the underlying synchronization and message passing minutiae under the abstractions it provides so that the programmer can concentrate on the application domain functionality. Great stuff!

I modified the code slightly so that the application actors exchange user-defined message types instead of std::strings.

req-resp CAF

Here is the modified code:

struct ReqMessage {
  int32_t anInt32_t;
  double aDouble;
  string aString;
};

struct RespMessage {
  enum class AckNack{ACK, NACK};
  AckNack response;
};

void printMsg(event_based_actor* self, const ReqMessage& msg) {
  aout(self) << "anInt32_t = " << msg.anInt32_t << endl
             << "aDouble = " << msg.aDouble << endl
             << "aString = " << msg.aString << endl
             << endl;
}

void fillReqMessage(ReqMessage& msg) {
  msg.aDouble = 55.5;
  msg.anInt32_t = 22;
  msg.aString = "Bulldozer00 Rocks!";
}

behavior responder(event_based_actor* self) {
  // return the (initial) actor behavior
  return {
  // a handler for messages of type ReqMessage
  // and replies with a RespMessage
  [=](const ReqMessage& msg) -> RespMessage {
    // prints the content of ReqMessage via aout
    // (thread-safe cout wrapper)
    printMsg(self, msg);
    // terminates this actor *after* the return statement
    // ('become' a quitter, otherwise loops forever)
    self->quit();
    // reply with an "ACK"
    return RespMessage{RespMessage::AckNack::ACK};
  }};
}

void requester(event_based_actor* self, const actor& responder) {
  // create & send a ReqMessage to our buddy ...
  ReqMessage req{};
  fillReqMessage(req);
  self->sync_send(responder, req).then(
  // ... wait for a response ...
  [=](const RespMessage& resp) {
    // ... and print it
    RespMessage::AckNack payload{resp.response};
    string txt =
      (payload == RespMessage::AckNack::ACK) ? "ACK" : "NACK";
    aout(self) << txt << endl;
  });
}

int main() {
  // create a new actor that calls 'responder()'
  auto responder_actor = spawn(responder);
  // create another actor that calls 'requester(responder_actor)';
  spawn(requester, responder_actor);
  // wait until all other actors we have spawned are done
  await_all_actors_done();
  // run cleanup code before exiting main
  shutdown();
}

And here is the Eclipse console output:
req-resp CAF output

Categories: C++, C++11 Tags: , , ,

Whence Actors?


While sketching out the following drawing, I was thinking about the migration from sequential to concurrent programming driven by the rise of multicore machines. Can you find anything wrong with it?

Concurrency Abstractions

Right out of the box, C++ provided Objects (via classes) and procedures (via free standing functions). With C++11, standardized support for threads and tasks finally arrived to the language in library form. I can’t wait for Actors to appear in….. ?

cpp actors

Categories: C++11, C++14, C++17 Tags: , , ,

It’s All About That Jell


Agile, Traditional, Lean, Burndown Charts, Kanban Boards, Earned Value Management Metrics, Code Coverage, Static Code Analysis, Coaches, Consultants, Daily Standup Meetings, Weekly Sit Down Meetings, Periodic Program/Project Reviews. All the shit managers obsess over doesn’t matter. It’s all about that Jell, ’bout that jell, ’bout that jell.

Jellin

 

 

All About The Jell

VCID, ACID, SCID


First, we have VCID:

VCID

In VCID mode, we iteratively define, at a coarse level of granularity, what the Domain-Specific Architecture (DSA) is and what the revenue-generating portfolio of Apps that we’ll be developing are.

Next up, we have ACID:

ACID

In ACID mode, we’ll iteratively define, at at finer level of detail, what each of our Apps will do for our customers and the components that will comprise each App.

Then, we have SCID, where we iteratively cut real App & DSA code and implement per-App stories/use cases/functions:

SCID

But STOP! Unlike the previous paragraphs imply, the “CID”s shouldn’t be managed as a sequential, three step, waterfall execution from the abstract world of concepts to the real world of concrete code. If so, your work is perhaps doomed. The CIDs should inform each other. When work in one CID exposes an error(s) in another CID, a transition into the flawed CID state should be executed to repair the error(s).

CID STM

Managed correctly, your product development system becomes a dynamically executing, inter-coupled, set of operating states with error-correcting feedback loops that steer the system toward its goal of providing value to your customers and profits to your coffers.

CID Timeline

Nothing Is Unassailable


I recently posted a tidbit on Twitter which I thought was benignly unassailable:

Unassailable

Of course, Twitter being Twitter, I was wrong – and that’s one of the reasons why I love (and hate) Twitter. When your head gets too inflated, Twitter can deflate it as fast as a pin pops a balloon.

type_names

Follow

Get every new post delivered to your Inbox.

Join 495 other followers

%d bloggers like this: